2023/06/21分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Move trilogy config closer to mysql2
activerecord/test/config.example.yml
の修正です。
Trilogy adapterに関する設定をmysql2 adapterの設定の近くに移動しています。
Update devcontainer.json to use Shopify.ruby-lsp extension
.devcontainer/devcontainer.json
の修正です。
vscodeのextensionにShopify.ruby-lsp
を追加しています。
Fix devcontainer trilogy connection for tests
.devcontainer/devcontainer.json
の修正です。
devcontainerでTrilogyのテストが通るようMYSQL_SOCK
の設定を追加しています。
Revert "Merge pull request #48527 from ghiculescu/active-record-enum-id"
enumのkeyにprimary keyに指定しているattribute名を使用出来ないよう修正した、Disallow `id` as an enum value in Active RecordをRevertしています。この変更によりrailtiesのテストがコケるようになってしまった為。
Merge pull request #48487 from lazaronixon/scope-subqueries
activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb
、
activerecord/lib/active_record/table_metadata.rb
の修正です。
associationのsubqueriesにscopeを適応するよう修正しています。
class Author < ApplicationRecord has_many :welcome_posts, -> { where(title: "welcome") } end
Before:
Author.where(welcome_posts: Post.all) #=> SELECT (...) WHERE "authors"."id" IN (SELECT "posts"."author_id" FROM "posts")
After:
Author.where(welcome_posts: Post.all) #=> SELECT (...) WHERE "authors"."id" IN (SELECT "posts"."author_id" FROM "posts" WHERE "posts"."title" = 'welcome')
Revert "Revert "Merge pull request #48527 from ghiculescu/active-record-enum-id""
activerecord/lib/active_record/enum.rb
の修正です。
enumのkeyにid
という値を使用出来ないよう修正しています。enumでid
メソッドが定義されてしまうと予期せぬ挙動になることがある為。Disallow `id` as an enum value in Active Recordのリトライ。
Fix the name of delegated method for the records to Array#intersect?
activerecord/lib/active_record/relation/delegation.rb
の修正です。
intersect?
をintersects?
にタイポしていたのを修正しています。
Merge pull request #48526 from ghiculescu/active-job-docs
rails guideのTesting Rails Applications
の修正です。
Active Job のテストについて説明している箇所で、enqueueされたjobが実行される旨説明が記載されていたのですが、実際は実行はされる事は無いため、該当の説明を修正、及び、テストでenqueueしたjobを実行する方法についての説明を追加しています。
Test delegation of Relation to Array#intersect? only in Ruby >= 3.1.0
activerecord/test/cases/relation/delegation_test.rb
の修正です。
Ruby 3.1.0で追加されたArray#intersect?
を使用するテストを、Ruby 3.1.0以上でのみ実行するよう修正しています。
Merge pull request #48471 from mdh/improve-naming-of-local-secret-generation
railties/lib/rails/application.rb
の修正です。
local environments (developmentとtest)で使用するsecretを生成するメソッド名、ファイル名がdevelopment_secret
になっていたのをlocal_secret
に変更しています。testでも使用する処理のため、local
の方が適切だろう、という事で修正されています。
activerecord/CHANGELOG.md
の修正です。
Array#intersect?
-> Array#intersects?
に修正しています。しかしこれは元の値(Array#intersect?
)が正しいです。