2024/06/13分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Fix action-text-attachment HTML escaping regression test
actiontext/test/unit/attachment_test.rbの修正です。
Action Textでattachmentがアップロードされた場合の挙動のテストで、テストで使用するメソッドを誤っていたのを修正しています。
Don't try to set invalid cookies.
actionpack/test/dispatch/cookies_test.rbの修正です。
テストで不正な文字をcookieを設定しないよう修正しています。Rack 3.1でdeprecatedになった挙動で、Rack 3.2ではcookieに不正な文字を指定した場合にexceptionがraiseされるようになっているため。
Merge pull request #52069 from otorain/fix-redundant-package-in-ci-template
railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt、
railties/lib/rails/generators/rails/plugin/templates/github/ci.yml.ttの修正です。
GitHub ActionsでDB用のパッケージをインストールする際に、同じパッケージが重複して指定されていたのを修正しています。
Merge pull request #49240 from deepakmahakale/notes-ui
railtiesの修正です。
bin/rails notesで表示している内容(annotationがついているコメント)をブラウザ(/rails/info/notes)で確認出来るよう対応しています。
Merge pull request #52100 from jdlubrano/fix-activerecord-configs-shadowing
activerecord/lib/active_record/railtie.rbの修正です。
new_framework_defaultsで指定したconfig.active_record.run_after_transaction_callbacks_in_order_definedが反映されないバグがあったのを修正しています。
Fix typo in global_executor_concurrency error message (#52103)
activerecord/lib/active_record.rbの修正です。
global_executor_concurrencyに不正な値が指定された場合のエラーメッセージ内のタイポを修正しています。
rails guideのUpgrading Ruby on Railsの修正です。
Upgrading from Rails 7.0 to Rails 7.1セクションに、devとtest envのsecret_key_baseを読み込むファイルのファイル名が変更になっている事についての説明を追加しています。
Improve ActiveSupport::MessageVerifier and ActiveRecord::SignedId docs
docの修正です。
ActiveSupport::MessageVerifier、及び、ActiveRecord::SignedIdのdocについて、言い回しの修正、Signing処理は暗号化ではない(単にencodingされているだけ)である旨の説明を追加しています。
Merge pull request #52054 from justinko/issue-52000
activerecord/lib/active_record/test_fixtures.rbのdocの修正です。
TestFixtures#fixtureメソッドについてのdocを追加しています。
[ActiveSupport] Add option filter on in_order_of (#52072)
activesupport/lib/active_support/core_ext/enumerable.rbの修正です。
in_order_ofメソッドに、指定された値と一致しない値を除外するかどうかを指定するためのオプション(filter)を追加しています。デフォルトはtrue(除外、今までと同じ挙動)で、除外したくない場合はfalseを指定すればOKです。
# 'filter' is true [ Person.find(5), Person.find(3), Person.find(1) ].in_order_of(:id, [ 1, 5 ]) # => [ Person.find(1), Person.find(5) ] # 'filter' is false [ Person.find(5), Person.find(3), Person.find(1) ].in_order_of(:id, [ 1, 5 ], filter: false) # => [ Person.find(1), Person.find(5), Person.find(3) ]
[ActiveRecord] Add option filter on in_order_of (#51761)
activerecord/lib/active_record/relation/query_methods.rbの修正です。
先程のActive Supportの対応と同様に、Active Recordのin_order_ofにもfilterオプションを追加しています。
order = [3, 4, 1] # 'filter' is true Post.in_order_of(:id, order).to_sql # SELECT # "posts".* FROM "posts" # WHERE # "posts"."id" IN (3, 4, 1) # ORDER BY # CASE WHEN "posts"."id" = 3 THEN 1 WHEN "posts"."id" = 4 THEN 2 WHEN "posts"."id" = 1 THEN 3 END ASC # 'filter' is false Post.in_order_of(:id, order, filter: false).to_sql # SELECT # "posts".* FROM "posts" # ORDER BY # CASE WHEN "posts"."id" = 3 THEN 1 WHEN "posts"."id" = 4 THEN 2 WHEN "posts"."id" = 1 THEN 3 ELSE 4 END ASC
Merge pull request #52059 from fatkodima/move-associations-errors-to-errors
Active Recordの修正です。
activerecord/lib/active_record/associations.rbで定義されていたエラー関係のクラスをactiverecord/lib/active_record/associations/errors.rbに移動し、このファイルをactiverecord/lib/active_record/errors.rbでロードするよう修正しています。eager_loadがtrueの場合に、 activerecord/lib/active_record/associations.rbが読み込まれる前にエラークラスが使用されてエラーになる、という事があり、それを避けるため。
Log trace of causes for unhandled exceptions
actionpack/lib/action_dispatch/middleware/debug_exceptions.rbの修正です。
ActionDispatch::DebugExceptionsでexceptionのcauseを表示する際に、エラーが発生した箇所のソースの情報も表示するよう修正しています。
properly reference tables from Arel in #order
activerecord/lib/active_record/relation/query_methods.rbの修正です。
ActiveRecord::Relation#orderにArel::Attributeのオブジェクトを渡した場合に正しくSQLが組み立てられないバグがあったのを修正しています。
Harden the .current_transaction API
Active Recordの修正です。
current_transaction APIについて、transactionがfinalizedした後にcurrent_transaction経由でメソッドを呼び出した場合にerrorをraiseするよう修正、transaction外の場合にActive Record notificationのtransaction payloadをnull-objectからnilに変更、等の改善を行っています。
ActiveRecord::Transaction#open? returns false if the transaction is finalized
activerecord/lib/active_record/transaction.rbの修正です。
transactionがfinalizedしている場合、ActiveRecord::Transaction#open?がfalseを返すよう修正しています。