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?
についての説明を追加しています。