2024/01/19分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Merge pull request #50783 from Shopify/append-pk-to-returning-columns-if-returning-is-empty
activerecord/lib/active_record/model_schema.rb
の修正です。
RETURNING
に他のカラムが指定されていない場合、必ずprimary_key
を返すよう修正しています。Rails 7.0まではカラムが指定されてなかった場合必ずprimary_key
を返すようになっていたのが、Rails 7.1で返さないよう変更されてしまったため、7.0までと同じ挙動になるよう修正しています。
Merge pull request #50775 from mockdeep/rf-thread_fix
actionview/lib/action_view/unbound_template.rb
の修正です。
strict localsを使用している場合に、@templates
への値の設定処理がスレッドアンセーフになっていたのを修正しています。
[Tests only] Expand trigger populated PK test case to run against more DBs
activerecord/test/cases/persistence_test.rb
、
activerecord/test/schema/schema.rb
の修正です。
DB側のTRIGGERでPKを生成する場合の挙動のテストがPostgreSQLでのみ実行されていたのを、MySQLでも実行でもするよう修正しています。
Merge pull request #50737 from skipkayhil/hm-further-optimize-tag-builder
actionview/lib/action_view/helpers/tag_helper.rb
の修正です。
TagBuilder
のtag生成処理で不要なオブジェクトの生成を減らすようリファクタリングしています。
Remove outdated comment in ExceptionsWrapper#show? [ci skip]
actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
の修正です。
ExceptionsWrapper#show?
のコード内から現在の実装と異なる内容のコメントを削除しています。
Print bin/rails help on unrecognized bare options
railties/lib/rails/command.rb
の修正です。
bin/rails
に不正なオプションが指定された場合にusageを表示するよう修正しています。
before
$ bin/rails -V rake, version 13.0.6 $ bin/rails -s Running 0 tests in a single process (parallelization threshold is 50) ... $ bin/rails -S invalid option: -S
after
$ bin/rails -V Usage: bin/rails COMMAND [options] You must specify a command. The most common commands are: ... $ bin/rails -s Usage: bin/rails COMMAND [options] You must specify a command. The most common commands are: ... $ bin/rails -S Usage: bin/rails COMMAND [options] You must specify a command. The most common commands are: ...
Fix bin/rails -T
when no default task is defined
railties/lib/rails/commands/rake/rake_command.rb
の修正です。
default taskが何も定義されていない場合にbin/rails -T
を実行した場合に、UnrecognizedCommandError
raiseされてしまうバグがあったのを修正しています。
Remove unsupported values for config.action_dispatch.show_exceptions [ci skip]
rails guideのConfiguring Rails Applications
の修正です。
config.action_dispatch.show_exceptions
について説明している箇所から、現在は使用出来ない値について説明している箇所を削除しています。
Fix RateLimitingTest assertion for :by option
actionpack/test/controller/rate_limiting_test.rb
の修正です。
rate_limiting
にby
オプションを指定するテストで、by
に指定されたオプションに関するテストが正しく行われてなかったのを修正しています。
activerecord/lib/active_record/nested_attributes.rb
の修正です。
nested attributes associationのwriterに不正な値を指定した場合に、ArgumentError
をraiseするよう修正しています。元々、associationがcollection associationだった場合はArgumentError
するようになっていたのですが、associationがsingular associationの場合はそうなっておらず、この対応によりsingular associationの場合も同じようにArgumentError
をraiseするようになっています。
Freeze and dedup quote_column_name
and quote_table_name
caches
Active Recordの修正です。
quote_column_name
、quote_table_name
メソッドでfreezeした値を返すよう修正しています。誤って呼び出し側で値を変更してしまうのを避ける為。
Add example to parts documentation [ci-skip]
activesupport/lib/active_support/duration.rb
のdocの修正です。
Duration#parts
メソッドのdocにexampleコードを追加しています。