2024/03/25分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Wrap by parentheses custom complex sql literals in update_all
activerecord/lib/active_record/relation.rbの修正です。
update_allにSQLが指定された場合に、そのSQLを丸括弧で括るよう修正しています。複雑なSQLが指定された場合等にSQLエラーになってしまうのを避ける為。
Merge pull request #51401 from chrisgibson/remove-taps-from-brewfile
Brewfileの修正です。
不要なtapを削除しています。
Merge pull request #51349 from Shopify/connection-optional-deprecation
Active Recordの修正です。
非推奨になったActiveRecord::Base.connectionを使用した場合の挙動をconfig(config.active_record.permanent_connection_checkout)で指定出来るよう修正しています。指定出来る値は3つで、
:disallowed: エラーをraise:deprecated: deprecateメッセージを出力:true: 何もしない
となっています。デフォルトはtrueです。
Put plural inverse association inference behind a configuration flag
activerecord/lib/active_record/reflection.rbの修正です。
pluralized nameに対するinverse relationsの検索を自動で行うかどうかをconfig(automatically_invert_plural_associations)で指定出来るよう修正しています。基本的にはinverse処理は行った方が良い(不要なSQLの実行を減らせる為)のですが、元のコードによってはinverse処理の影響で挙動が変更してしまう可能性があります。そのため、段階的に対応を進められるようにする為、一時的にinverse処理を無効化出来るよう対応しています。 このconfigはアプリケーション全体、及び、modelごと、それぞれ設定出来るようになっています。has_many through associationについて、自動でinverse relationsの検索が行われるようになった(Infer :inverse_of for has_many ..., through:))ことによりbreaking changesが発生した場合に対応出来るようにするため。
Bump NODE_LTS_VERSION to 20.11.1
railties/lib/rails/generators/app_base.rbの修正です。
新規にアプリケーションを作成した場合に使用するNode.jsのバージョンを20.11.1に更新しています。現在のLTSが左記バージョンの為。
Fix typo on ActiveRecord::Associations::ClassMethods doc
activerecord/lib/active_record/associations.rbのdocの修正です。
belongs_toメソッドのdocで、belongs_toをbelong_toにタイポしていたのを修正しています。
Add CHANGELOG entries for association composite primary and foreign keys
activerecord/CHANGELOG.mdの修正です。
associationのprimary_keyオプションにArrayを指定出来るようにした、Allow primary_key: association option to be composite、及び、associationのforeign_keyオプションにArrayを指定出来るようにした、Allow association foreign_key to be an Arrayの対応についてCHANGELOGのエントリーを追加しています。
Fix a typo in automatically_invert_plural_associations documentation
rails guideのConfiguring Rails Applicationsの修正です。
config.active_record.automatically_invert_plural_associationsについて説明している箇所のタイポを修正しています。
Minor text / error message tweaks, fixes, and punctuation
docの言い回しやグラマー、エラーメッセージ内のフォーマットの修正等を行っています。
Merge pull request #51389 from lxxxvi/add-documentation-for-rails-env-local-questionmark
railties/lib/rails.rbのdocの修正です。
Rails.envメソッドのdocにRails.env.local?についての説明を追加しています。