2017/06/29分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Query cache was unavailable when entering the ActiveRecord::Base.cache block without being connected.
- Fix eager loading to respect
store_full_sti_class
setting. - Deprecate delegating to
arel
inRelation
.
Merge pull request #29595 from fatkodima/result_lambda_class_checking
actionpack/lib/abstract_controller/callbacks.rb
、
activesupport/lib/active_support/callbacks.rb
の修正です。
callback処理の中で引数がProc
がどうかチェックしていたのを削除しています。渡される値は必ずProc
であり、チェックが不要な為。
Merge pull request #29588 from greysteil/add-gemspec-links
各コンポーネントのgemspecに、metadataとしてsource_code_uri
とchangelog_uri
を設定しています。
s.metadata = { "source_code_uri" => "https://github.com/rails/rails/tree/v#{version}/activemodel", "changelog_uri" => "https://github.com/rails/rails/blob/v#{version}/activemodel/CHANGELOG.md" }
こんなの書けるんですねえ。知らなかった。参考:Leverage metadata to populate gems urls v2 by kbrock · Pull Request #1234 · rubygems/rubygems.org
因みにPRを投げた方は、Dependabot - Automated Dependency UpdatesでPRを投げる際のリンクに使用する予定だそうです。
Merge pull request #29600 from kamipo/show_query_cache_keys
activerecord/test/cases/query_cache_test.rb
の修正です。
test_exceptional_middleware_clears_and_disables_cache_on_error
でテストに失敗した際にquery cacheのkeyを表示するよう修正しています。
test_exceptional_middleware_clears_and_disables_cache_on_error
は最近CI上でランダムでエラーになるようになっており、エラーになった際の調査の為に表示するようにしています。
Add a test case for unscoping default_scope
in associations
activerecord/test/cases/associations/has_many_associations_test.rb
の修正です。
associationのdefault_scope
をunscopeした場合のテストを追加しています。
Don’t passing klass.connection
to AssociationScope
Active Recordの修正です。
Associations::AssociationScope.scope
、#scope
の引数からconnection
を削除しています。
上記メソッドは第一引数にassociation
を渡しており、association
からconnection
を取得出来る為。
Enable query cache if set a configurations
activerecord/lib/active_record/query_cache.rb
の修正です。
DBへのconnectionがないと、ActiveRecord::Base.cache
を呼び出してもquery cacheが使用されなかったのを、connectionが無い状態でも接続先の情報があればquery cacheが使用されるよう修正しています。
Fix eager loading to respect store_full_sti_class
setting
activerecord/lib/active_record/reflection.rb
の修正です。
eager loadを行う際にstore_full_sti_class
の設定内容が無視されていたのを、store_full_sti_class
が設定されている場合も正しいtype
をloadするよう修正しています。
Fix grammar for documentation of rails/command.rb [ci skip]
rails guideのThe Rails Initialization Process
の修正です。
rails/command.rb
の項のグラマーの修正を行っています。
Show query cache keys in test_middleware_caches
activerecord/test/cases/query_cache_test.rb
の修正です。
activerecord/test/cases/query_cache_test.rb
の修正です。
test_middleware_caches
でテストに失敗した際にquery cacheのkeyを表示するよう修正しています。
先ほどのtest_exceptional_middleware_clears_and_disables_cache_on_error
と同様に、ランダムでテストがエラーになってしまう為、調査用。
Remove delegating to arel in a relation
Active Recordの修正です。
Relationで一部処理をarelにdelegateしていたのを、delegateしないよう修正しています。
delegateが必要なのはrelation.bound_attributes
を使用する場合だけで、その場合は直接relation.arel
を呼ぶようににして対応しています。
Merge pull request #28928 from kamipo/remove_habtm_initialize
activerecord/lib/active_record/reflection.rb
の修正です。
不要なHasAndBelongsToManyReflection#initialize
メソッドを削除しています。
Merge pull request #29076 from kamipo/use_timestamp_attributes_for_update_in_model
activerecord/lib/active_record/timestamp.rb
の修正です。
Timestamp#max_updated_column_timestamp
メソッドのtimestamp_names
のデフォルト引数を取得するのにtimestamp_attributes_for_update
を使用していたのを、timestamp_attributes_for_update_in_model
メソッド経由で値を取得するよう修正しています。
Merge pull request #29416 from kamipo/remove_unused_subject_model
activerecord/test/models/subject.rb
の修正です。
使用していないSubject
modelを削除しています。
Merge pull request #29301 from kamipo/receiver_in_scope_should_be_relation
activerecord/lib/active_record/scoping/named.rb
の修正です。
Scoping::Named#scope
メソッドでinstance_exec
を実行するレシーバーがklass
になっていたのを、relation
になるよう修正しています。
default_scope
やassociationのscope処理ではレシーバーがrelation
になっており、合わせる為に、との事です。
Merge pull request #29129 from kamipo/prevent_extra_through_scope
activerecord/lib/active_record/associations/preloader/through_association.rb
の修正です。
reset_association
メソッド内でthrough_scope
を呼び出していたのを、reset_association
の引数にthrough_scope
を渡すようにして、不要な呼び出しを行わないよう修正しています。
Merge pull request #29612 from kamipo/use_quote_method_rather_than_single_quote
Active Recordの修正です。
カラムやテーブルのクォート処理に'
を指定している箇所があったのを、quote
メソッドを使用するよう修正しています。
Merge pull request #28932 from kamipo/remove_method_missing_in_relation_delegation
activerecord/lib/active_record/relation/delegation.rb
の修正です。
呼び出される事の無いRelation::Delegation
のmethod_missing
を削除しています。
Merge pull request #29569 from kamipo/fix_to_scoping_is_correctly_restored
activerecord/lib/active_record/relation.rb
、
activerecord/lib/active_record/scoping.rb
の修正です。
STI subclassが、parent classのunscoped
blockの中でunscoped
を使用した場合に、blockの外に出ても元のscopeに正しく戻されないバグがあったのを修正しています。
Merge pull request #29616 from kamipo/remove_unused_aliased_table_name
activerecord/lib/active_record/associations/association.rb
の修正です。
使用していないAssociation
のaliased_table_name
メソッドを削除しています。
Deprecate delegating to arel
in Relation
activerecord/lib/active_record/relation/delegation.rb
の修正です。
Relation
がarel
にdelegateしていたメソッドがdeprecateになりました。
現状、arel
にdelegateするメソッドがどれかが不明確な状態になっています(klass
にdelegateするメソッドとarel
にdelegateするメソッドが混在している)。不明確な状態をなくす為に、arel
へのdelegateは無くす方向で考えいるようで、その前段階として、delegate
が行われた場合、deprecate
メッセージが表示されるよう対応しています。
Fix the next version of Rails from 5.3 to 6.0
activerecord/lib/active_record/relation/calculations.rb
の修正です。
deprecateメッセージで表示する次のRailsのバージョンを5.3
から6.0
に更新しています。5.2
の次は6.0
になる予定の為。