2024/01/12分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activejob/CHANGELOG.md
Merge pull request #50382 from summera/polymorphic-multi-db-preload-fix
activerecord/lib/active_record/associations/preloader/association.rb
の修正です。
polymorphic associationで同じテーブル名で違うDBに接続するmodelがあった場合、そのassociationのpreloadが正しく行われない(片方のmodelのみpreloadされる)バグがあったのを修正しています。
Prevent CurrentAttributes defaults from leaking
activesupport/lib/active_support/current_attributes.rb
の修正です。
ActiveSupport::CurrentAttributes
のsubclassを定義した場合に、ActiveSupport::CurrentAttributes
で定義されているdefault値がsubclassで参照出来ないよう修正しています。
[Fix #50713] Do not trigger loading of ActiveJob::Base in ActiveJob::TestHelper
activejob/lib/active_job/test_helper.rb
の修正です。
ActiveJob::TestHelper
load時に直接ActiveJob::Base
にテスト用のadapterをincludeしていたのを、ActiveSupport.on_load
を使用してActiveJob::Base
がloadされたときにincludeするよう修正しています。ActiveJob
のconfigの処理より前にActiveJob::Base
がloadされてしまうのを避けるため。
assert_queries doesn't exist anymore
activerecord/test/cases/associations_test.rb
の修正です。
assert_queries
-> assert_queries_count
に修正しています。
Merge pull request #50701 from rails/rm-load-schema
activerecord/lib/active_record/attribute_methods.rb
、
activerecord/lib/active_record/attribute_methods/primary_key.rb
の修正です。
model classにattributeが何も定義されていない場合に、id_value
に対するattribute_aliases
が定義されないバグがあったのを修正しいます。
Fix indenting in SQLite database.yml
railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt
の修正です。。
SQLite用のdatabase.yml
のインデントがずれている箇所があったのを修正しています。
Add examples to #slice and #values_at documentation [ci-skip] (#50679)
activemodel/lib/active_model/model.rb
、
activerecord/lib/active_record/core.rb
のdocの修正です。
ActiveModel::Model#slice
とActiveRecord::Core#slice
、及び、ActiveModel::Model#values_at
とActiveRecord::Core#values_at
のそれぞれのdoc内にexampleコードを追加しています。
Fix [#50260] Support :on
option in #set_callback
activerecord/lib/active_record/transactions.rb
の修正です。
Active Recordでcallbackを設定する為のActiveRecord::Transactions::ClassMethods#set_callback
メソッドを追加しています。Active SupportにすでにあるActiveSupport::Callbacks::ClassMethods#set_callback
メソッドと同じメソッドなのですが、after_commit
とafter_rollback
でcallback option(callbackの実行処理を制限する:on
オプションなど)をサポートする為にActive Recordに実装を追加しています。