2019/03/01分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
[ci skip] The find
method coerces the given arguments to integer if the primary key
is integer
activerecord/lib/active_record/relation/finder_methods.rb
のdocの修正です。
[ci skip] Fix the documentation of ActiveRecord::FinderMethods#findで修正したto_i
メソッドが呼ばれる条件の説明に誤りがあった(primary keyがinteger
の場合にto_i
が呼ばれるので元の説明が正しい)のを再度修正しています。
Removes unnecessary dot in regexp
actionview/lib/action_view/helpers/translation_helper.rb
の修正です。
TranslationHelper#html_safe_translation_key?
メソッドの正規表現から、不要なドットを削除しています。
Reset dirty topics
table for SerializedAttributeTest
activerecord/test/cases/serialized_attribute_test.rb
の修正です。
SerializedAttributeTest
実行時にtopics
tableをリセットするよう修正しています。
topics
tableの状態を変えてしまうテストがあり、その影響でSerializedAttributeTest
がエラーになってしまうのを避ける為。
Avoid Topic.dup
to prevent weird test failure
activerecord/test/cases/serialized_attribute_test.rb
の修正です。
test_serialized_attribute_works_under_concurrent_initial_access
でテスト用にmodelをdup
していた(テスト内でattributeを変更しており他のテストに影響が出るのを避ける為)のを、Class.new
でサブクラスを作成するよう修正しています。
dup
してクラスを作成すると何故かエラーになってしまう事がある為。
activerecord/test/cases/serialized_attribute_test.rb
の修正です。
使用していないrequireを削除しています。
Merge pull request #33611 from willianveiga/feature/reselect-method
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
ActiveRecord::QueryMethods
にselect
statementを再指定する為のreselect
メソッドを追加しています。 unscope(:select).select(fields)
のショートハンド。
Post.select(:title, :body).reselect(:created_at) # => SELECT `posts.created_at` FROM `posts`
Relax table name detection in from
to allow any extension like INDEX hint
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
from
メソッドのテーブル名取得処理を修正し、from("comments USE INDEX (PRIMARY)")
のようなINDEX hintを含むSQLも使用出来るよう修正しています。Rails 5.2まではこのような使い方が出来、元の挙動を維持する為。
Merge pull request #35431 from kamipo/enable_sql_cache_on_find
activerecord/lib/active_record/core.rb
の修正です。
base classではfind
メソッドでSQL statement cacheが有効になるよう修正しています。