2018/12/20分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actioncable/CHANGELOG.md
actionmailer/CHANGELOG.md
activejob/CHANGELOG.md
activemodel/CHANGELOG.md
activestorage/CHANGELOG.md
Clarify implicit meaning of 'workers: 2' in parallelization tests.
railties/test/application/test_runner_test.rb
の修正です。
parallel testの並列数を強制的に設定する為のヘルパーメソッドの名前を、わかりやすい名前(substitute_arguments_of_parallelize_method
-> exercise_parallelization_regardless_of_machine_core_count
)に変更しています。
色々と相談があった結果、Rails 6がサポートするバージョンはRuby 2.5以上となり、required_ruby_version
を>= 2.5.0
に修正、不要なメソッドの削除等を行っています。
actionmailer/test/base_test.rb
の修正です。
mail gem 2.8でmessage id戻り値が変更される事によりエラーになってしまうテストがあったのを修正しています。
2.8はまだリリースされてはいないのですが、先行して対応しています。
関連:Handle a wide variety of non-rfc Message-Id formats
Merge pull request #30973 from k0kubun/prefer-block-parameter
activemodel/lib/active_model/attribute_set.rb
、
activerecord/lib/active_record/attribute_methods/read.rb
の修正です。
JRuby とそれ以外の処理系とでブロックに関する処理を分けている箇所があったのを、どの処理系でも同じ処理(ブロックパラメータを使用する方法)を行うよう修正しています。
- if defined?(JRUBY_VERSION) - # This form is significantly faster on JRuby, and this is one of our biggest hotspots. - # https://github.com/jruby/jruby/pull/2562 - def _read_attribute(attr_name, &block) # :nodoc: - @attributes.fetch_value(attr_name.to_s, &block) - end - else - def _read_attribute(attr_name) # :nodoc: - @attributes.fetch_value(attr_name.to_s) { |n| yield n if block_given? } - end + def _read_attribute(attr_name, &block) # :nodoc + @attributes.fetch_value(attr_name.to_s, &block) end
元々CRubyではブロックパラメータを使うと遅くなるという問題があった為上記のような処理になっていたのですが、Ruby 2.5でブロックパラメータを用いたブロック渡しが高速化されている、かつ、今のmasterではRuby 2.5以上のみをサポートするようなった為、上記修正を行っています。
Use native Array#append
, Array#prepend
, Hash#transform_keys
, and Hash#transform_keys!
Active Supportの修正です。
Array#append
, Array#prepend
, Hash#transform_keys
, Hash#transform_keys!
メソッドを削除しています。Ruby 2.5以上をサポートしたことにより、これらのメソッドは必ずRubyに定義されている為。