2017/11/20分のコミットです。
CHANGELOGへの追加はありませんでした。
Generate keys
instead of keys_to_names
activesupport/lib/active_support/cache/redis_cache_store.rb
の修正です。
RedisCacheStore#read_multi_mget
メソッドでmgetする際にnameとノーマライズしたkeyのペアのHashを生成していたのを、keyの配列だけ生成するよう修正しています。ペアで使用する事が無かった為。
Fix ASt CI failure with rack-test 0.7.1
activestorage/test/models/attachments_test.rb
の修正です。
UploadedFile
を使用したテストで、Rack::Test::UploadedFile.new
の引数にPathname
のインスタンスを渡していたのを、pathのStringを渡すよう修正しています。
rack-test
0.7.1からPathname
のインスタンスを渡せなくなってしまった為のようです。
参考:Add the ability to create Test::UploadedFile instances without the fi…
Fix test_session_store_with_expire_after
failure with rack-test 0.7.1
actionpack/test/dispatch/session/cookie_store_test.rb
の修正です。
cookieの指定が不足していた部分があったのを修正しています。こちらもrack-test
0.7.1の影響。
Prevent extra spawn
to make klass.all
faster (#29009)
activerecord/lib/active_record/core.rb
、
activerecord/lib/active_record/scoping/default.rb
の修正です。
klass.all
を使用した際に、spawn
の呼び出しを減らせるようリファクタリングしています。
一部抜粋。
- relation.where(type_condition).create_with(inheritance_column.to_s => sti_name) + relation.where!(type_condition) + relation.create_with!(inheritance_column.to_s => sti_name)
where
やcreate_with
の代わりにwhere!
やcreate_with!
を使用して、自身を直接変更するようにしています。高速化の為。STIを使用している場合、30%程度all
がはやくなっているとの事です。
Permit attaching files to new records
activestorage/lib/active_storage/attached/many.rb
、
activestorage/lib/active_storage/attached/one.rb
の修正です。
新規に作成したオブジェクト(まだレコードが保存されていない)からattachmentsを参照した場合、エラーになってしまうバグがあったのを修正しています。
Merge pull request #31170 from PHedkvist/system_testing_guides
rails guideのA Guide to Testing Rails Applications
の修正です。
System Testing
の項に、headless_chrome
を使用する場合の設定方法について追記しています。
Pass over Execution guide[ci skip]
rails guideのThreading and Code Execution in Rails
の修正です。
guide全体のグラマー、タイポの修正を行っています。