2020/05/05分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Inspect time attributes with subsec.
- Fix
rewhere
to truly overwrite collided where clause by new where clause.
actionmailer/CHANGELOG.md
- Remove deprecated
ActionMailer::Base.receive
in favor of Action Mailbox. - Remove deprecated
ActionMailer::DeliveryJob
andActionMailer::Parameterized::DeliveryJob
in favor ofActionMailer::MailDeliveryJob
.
- Remove deprecated
force_ssl
at the controller level. fixture_file_upload
now uses path relative tofile_fixture_path
Remove hashing from secure_compare and clarify documentation
activesupport/lib/active_support/security_utils.rb
の修正です.
secure_compare
メソッドでfixed_length_secure_compare
を呼び出す際にハッシュ化していたのを削除しています。
ハッシュ化だと文字列の内容の推測を防ぐ事は出来るが文字列の長さの推測を防ぐ事が出来ず(ハッシュ化の実行が文字列の長さに依存する為)ハッシュ化してもセキュリティ上のメリットが無いため、代わりに長さでのチェックを行うようにした、との事です。
Add a separator to the cache key for ActiveSupport::CachingKeyGenerator
activesupport/lib/active_support/key_generator.rb
の修正です。
ActiveSupport::CachingKeyGenerator
のcache keyにセパレータを追加するよう修正しています。
このcache keyはsaltとkey lengthを単純に連結している為、例えば、@caching_generator.generate_key("133", 7)
と@caching_generator.generate_key("13", 37)
で同じkey(1337
)が生成されてしまっていまい、後者の場合に想定通りのkey lengthにならない、という問題がありました。で、これを避ける為に、saltとkey lengthの間にセパレータを追加し対応しています。
Style fix for CachingKeyGenerator
activesupport/lib/active_support/key_generator.rb
の修正です。
rubocopの設定に違反している箇所があったのを修正しています
Inspect time attributes with subsec
activerecord/lib/active_record/attribute_methods.rb
の修正です。
Active Recordのtime attributesのinspect結果にsubsecの値も含むよう修正しています。
Fix flakey destroyed_by_association tests
activerecord/test/cases/associations/has_one_associations_test.rb
の修正です。
destroyed_by_association
テストで想定外のデータが削除されてしまうのを避ける為に、明示的にfixtureで必要なデータをロードするよう修正しています。
Remove obsolete explain logging test
activerecord/test/cases/explain_test.rb
の修正です。
既に削除済みのauto-explainの為のテストが残っていたのを削除しています。
Include parallelize :threads option when fork is not available
railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt
の修正です。
rails new
で生成されるtest_helper.rb
に、forkが使えない環境ではparallelize
にスレッドオプションを指定するよう修正しています。
Fix rewhere
to truly overwrite collided where clause by new where clause
activerecord/lib/active_record/relation/query_methods.rb
、
activerecord/lib/active_record/relation/where_clause.rb
の修正です。
rewhere
で指定したconditionで元のwhere
のconditionが正しくオーバーライトされないケースがあったのを修正しています。
Merge pull request #39051 from kamipo/more_concise_or_ast
activerecord/lib/active_record/relation/where_clause.rb
、
activerecord/lib/arel/visitors/to_sql.rb
の修正です。
or
を1000回呼び出すと、"Stack level too deep"が発生してしまうバグがあったのを修正しています。
Merge pull request #39022 from kamipo/perf_where_in
Active Recordの修正です。
where
にvalueのArrayを指定した場合にオブジェクトの生成数を減らせるようリファクタリングしています。
Remove deprecated ActionMailer::Base.receive
in favor of Action Mailbox
Action Mailerの修正です。
deprecateになっていたActionMailer::Base.receive
メソッドを削除しています。
Remove deprecated ActionMailer::DeliveryJob
and ActionMailer::Parameterized::DeliveryJob
Action Mailerの修正です。
deprecateになっていたActionMailer::DeliveryJob
とActionMailer::Parameterized::DeliveryJob
を削除しています。
Remove deprecated force_ssl
at the controller level.
Action Packの修正です。
deprecateになっていたcontrollerレベルでのforce_ssl
を削除しています。
Remove unneeded test after force_ssl removal
railties/test/application/configuration_test.rb
の修正です。
先程削除したcontrollerレベルでのforce_ssl
に関するテストが残っていたのを削除しています。
Deprecate starts_with?
and ends_with?
for String core extensions
Active Supportの修正です。
String#starts_with?
及びString#ends_with?
メソッドをdeprecateにしています。
Ruby本体に同等のメソッド(start_with?
/ end_with?
)がある、かつ、starts_with?
/ ends_with?
を使用するとSymbol#start_with?
/ Symbol#end_with?
がある事のメリットをうけられない、という理由によりdeprecateになりました。
が、merge後にちょっと議論が発生し、String#starts_with?
及びString#ends_with?
はそのままとなる事になりました。
save
and save!
doesn't take positional arguments
Active Recordの修正です。
save
とsave!
メソッドのシグネチャが、positional引数とkeyword引数両方を受け取れるようになっていたのですが、save
とsave!
はpositional引数はそもそも受け取られない為、不要なシグネチャを削除しています。
Relax required rack-mini-profiler version 2.0.x to 2.x
railties/lib/rails/generators/rails/app/templates/Gemfile.tt
の修正です。
rails new
で生成されるGemfile
で、rack-mini-profiler
のバージョン指定が~> 2.0.0
になっていたのを、~> 2.0
に修正しています。
rails guideの修正です。
config.load_defaults
に指定する値がStringになっていたのを、rails new
で実際に生成される内容に合わせてFloatを使用するよう修正しています。
Follow up to 3f27aa8cdf8c3c7f36d630f0241854f712e4c937
activesupport/lib/active_support/cache.rb
の修正です。
キーワード引数を受け取れないsave_block_result_to_cache
メソッドのシグネチャに**
が指定されていたのを削除しています。
Type::Value#initialize
doesn't take positional arguments
activemodel/lib/active_model/type/integer.rb
の修正です。
Type::Value#initialize
メソッドのシグネチャが、positional引数とkeyword引数両方を受け取れるようになっていたのですが、positional引数は受け取られない為不要なシグネチャを削除しています。
Avoid synchronize { }
call only for MRI
actionpack/lib/action_dispatch/http/response.rb
、
activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
の修正です。
変数参照時にsynchronize
を使用するかどうかのチェックを、JRUBY_VERSION
が定義されているかどうかでチェックしていたのを、MRIの場合のみsynchronize
を使用しないよう修正しています。
Use the file_fixture_path
for fixture_file_upload:
actionpack/lib/action_dispatch/testing/test_process.rb
の修正です。
fixture_file_upload
メソッドがファイルを検索するのに、fixture_path
の相対パスで検索していたのがdeprecateになりました。今後はfile_fixture_path
の相対パスで検索されるようになります。
fixture_path
はActive Recordの為の値であり、file_fixture_path
がある今Action Packでfixture_path
を使うのは良くないのでは、という事でdeprecateになりました。
Revert "Merge pull request #39152 from kamipo/deprecate_starts_ends_with"
String#starts_with?
及びString#ends_with?
メソッドをdeprecateにした、Deprecate starts_with?
and ends_with?
for String core extensionsをRevertしています。