2019/04/10分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
レコードが存在するかどうかのチェック処理の際のログをxx Exists"
からxx Exists?
に修正しています。
xx Exists
だと存在チェックの為の処理である、という事が少しわかりづらい為との事です。
Merge pull request #35905 from BatedUrGonnaDie/dont-override-job-seed-adapter
railties/lib/rails/engine.rb
の修正です。
Seed database with inline ActiveJob job adapterでseedを読み込む際にActive Jobのadapterを強制的にinlineにするようにしたのですが、これをadapterがasyncの場合のみinlineにするよう修正しています。
inlineにした事により、modelの作成処理の流れでenqueue jobsを使用している場合(e.g. modelでafter_create { SomeJob.set(wait_until: 5.minutes.from_now).perform_later(self) }
を指定等)に、そこでエラーになってしまう(inline adapterだとenqueue jobsを使用出来ない為)というリグレッションが発生していました。で、その対応として、async(デフォルト)の場合のみinlineにするようにし、明示的にadapterが指定されている場合は何もしないようにしています。
Adds named_captures to MatchData to emulate Regex
actionpack/lib/action_dispatch/journey/path/pattern.rb
の修正です。
ActionDispatch::Journey::Path::MatchData
にnamed_captures
メソッドを追加しています。MatchData
のようにcaptureした値を取得する為のメソッドで、デバッグの際に使用する想定との事です。
Merge pull request #35875 from Shopify/alloc-free-comparisons
Active Recordの修正です。
TypeMetadata
、及び、Column
クラスの==
、hash
メソッドの比較処理でオブジェクトの生成を行わないようリファクタリングしています。
どちらのメソッドでも対象となるattributeをArray
に切り出してから処理を行っていたのですが、それをやめて直接値を参照するようにしています。
There is no need to create QueryAttribute
to just type cast a value
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
、
activerecord/lib/active_record/insert_all.rb
の修正です。
type castをするのに、Relation::QueryAttribute
のインスタンスを作成し使用していたの、Relation::QueryAttribute
は使用しないよう修正しています。type cast処理だけを行いたい場合Relation::QueryAttribute
は無くても処理は行える為。
Remove unused sequence_name
in sql_for_insert
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
、
activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb
の修正です。
sql_for_insert
メソッドから使用していないsequence_name
メソッドを削除しています。
Add assertions for lazy sync transaction state
activerecord/test/cases/transactions_test.rb
の修正です。
テストでtransaction stateについても確認するよう修正しています。
Exclude all node_modules
from the RuboCop check
.rubocop.yml
の修正です。
RuboCopの対象から全てのnode_modules
を除くよう修正しています。
Accidentally lost comment
in Column#==
and Column#hash
activerecord/lib/active_record/connection_adapters/column.rb
の修正です。
TypeMetadata
及びColumn
クラスの==
、hash
メソッドの比較処理を改善した、Merge pull request #35875 from Shopify/alloc-free-comparisonsで、比較するattributeからcomment
が誤って削除されてしまっていたのを再度比較の対象とするよう修正しています。
Merge pull request #28155 from lcreid/belongs_to
activerecord/lib/active_record/autosave_association.rb
の修正です。
autosave: true
が指定されている、かつ、参照が循環しているassociationがあった場合に、idの指定が無い不正なjoin recordが生成されてしまうバグがあったのを修正しています。
Remove unused callbacks in the Topic
model
activerecord/test/models/topic.rb
の修正です。
Topic
modelから使用していないコールバックを削除しています。
が、実際にはまだ使用している箇所があった為、次のコミットでRevertしています。
Revert "Remove unused callbacks in the Topic
model"
という訳で直前のコミットをRevertしています。
Adding type option example to the documentation [ci skip] (#35917)
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
のdocの修正です。
references
メソッドのdocにtype
オプションを指定した場合のexampleを追加しています。