2016/10/22分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Fixed: Optimistic locking does not work well with null in the database.
- Added ability update locking_column value
- Deprecate passing arguments and block at the same time to
ActiveRecord::QueryMethods#select
.
Additional fix for argument-splat ordering differences.
activesupport/lib/active_support/callbacks.rb
の修正です。
ActiveSupport::Callbacks#run_callbacks
メソッドでexpand_call_template
メソッドの戻り値をArrayとして扱っていたのを、個別に変数に格納するよう修正しています。
- expanded = current.expand_call_template(env, invoke_sequence) - expanded.shift.send(*expanded, &expanded.shift) + target, block, method, *arguments = current.expand_call_template(env, invoke_sequence) + target.send(method, *arguments, &block)
Explicitly unpack the expanded args to avoid execution order diff.の対応と同様、先に行われる事を期待していたスプラッティングがshift
より後に行われてしまっている為。
Add examples of queue_adapter and perform_enqueued jobs to API Docs.
activejob/lib/active_job/test_helper.rb
のdocの修正です。
ActiveJob::TestHelper#perform_enqueued_jobs
、#queue_adapter
メソッドにドキュメントを追加しています。
Fixed: Optimistic locking does not work well with null in the database
activerecord/lib/active_record/locking/optimistic.rb
の修正です。
optimize lockに使用するカラムがnull
だった場合に、ロック処理が正しく動作しないバグがあったのを修正しています。
Added ability update locking_column value
activerecord/lib/active_record/locking/optimistic.rb
の修正です。
optimize lockに使用するカラムの値(lock version)を明示的に更新出来るよう修正しています。またその際、lock versionが自動で更新されないよう(指定した値がそのまま反映されるよう)にしています。
Revert "Undefine assings in IntegrationTest"
IntegrationTest
クラスでassigns
をundefするよう修正した、Undefine assings in IntegrationTestをrevertしています。
元々、IntegrationTest
クラスでassigns
を定義している為に、rails-controller-testing gemで定義しているassigns
がIntegrationTest
動作しなと思われるという事でundef
したようなのですが、どうも関係無いようだったのでrevertしたようです。
参考:"assigns" in integration test not working · Issue #28 · rails/rails-controller-testing
Skip test that depends on RubyVM when it is not available (JRuby).
activesupport/test/executor_test.rb
の修正です。
class_serial
が増えない事を確認するテストを、RubyVM
が無い環境(JRuby)では行わないようskip処理を追加しています。
Prevent the test framework from being loaded in production mode
railties/lib/rails/commands/test/test_command.rb
、
railties/lib/rails/test_unit/railtie.rb
の修正です。
initializerで行っていたRails::LineFiltering
をActiveSupport::TestCase
にextendする処理を、実際にtest runner実行時に行うよう修正しています。
initializerで行ってしまうと、環境を問わずActiveSupport::TestCase
のload処理が行われてしまう為、productionのようなActiveSupport::TestCase
のload処理が不要な環境でのload処理を行われないようにする為にextendのタイミングを修正したとの事です。
が、これは後ほどon_load
を使用するよう修正されています。
Soften this test since YAML.dump may produce keys in other orders.
Use on_load
to trigger commandline processing code
activesupport/lib/active_support/test_case.rb
、
railties/lib/rails/commands/test/test_command.rb
、
railties/lib/rails/test_unit/railtie.rb
の修正です。
Rails::LineFiltering
をActiveSupport::TestCase
にextendする処理を、ActiveSupport.run_load_hooks
を使用してActiveSupport::TesCase
がloadされた際に行うよう修正しています。
Merge pull request #26860 from headius/soft_ordering_in_yaml_dump
actionpack/test/controller/parameters/serialization_test.rb
の修正です。
ActionController::Parameters
をyamlにserializeするテストで、serialize結果をまとめて1つのassertionで書くんするようになっていたのを、行毎にassertionをわけるよう修正しています。
- assert_equal <<-end_of_yaml.strip_heredoc, YAML.dump(params) - --- !ruby/object:ActionController::Parameters - parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess - key: :value - permitted: false - end_of_yaml + yaml_dump = YAML.dump(params) + assert_match("--- !ruby/object:ActionController::Parameters", yaml_dump) + assert_match(/parameters: !ruby\/hash:ActiveSupport::HashWithIndifferentAccess\n\s+key: :value/, yaml_dump) + assert_match("permitted: false", yaml_dump)
JRubyのYAML engineはlibyamlではなく、serializeした結果の順番はCRubyとは異なる為、との事です。へー。
Lazy-load blade for actioncable tests; no blade on JRuby.
actioncable/Rakefile
の修正です。
ファイルの先頭で行っていたblade
のrequireを、実際に使用する箇所でrequireするよう修正しています。
JRubyではblade
gemは提供されておらず、ファイルの先頭でrequireしてしまうとJRubyでテスト実行時にそこでエラーになってしまう為。
Merge pull request #26826 from claudiob/add-require
activesupport/lib/active_support/hash_with_indifferent_access.rb
の修正です。
不足していたactive_support/core_ext/hash/indifferent_access
のrequireを追加しています。
Merge pull request #26843 from denisovlev/strptime_timestamps
activesupport/lib/active_support/values/time_zone.rb
の修正です。
ActiveSupport::TimeZone#strptime
で seconds (%s) 及び milliseconds (%Q) formatもサポートするよう対応しています。
# before ActiveSupport::TimeZone.new('UTC').strptime("1470272280000", "%Q") # => Sat, 22 Oct 2016 00:00:00 UTC +00:00 # after ActiveSupport::TimeZone.new('UTC').strptime("1470272280000", "%Q") #=> Thu, 04 Aug 2016 00:58:00 UTC +00:00
Fix regression caused due to removal of select method from CollectionAssociation
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
ActiveRecord::QueryMethods#select
にblockを渡す処理のサポートがdeprecateになりました。
正確には、Remove unnecessary `select` method for `CollectionProxy`で処理が削除されていたのですが、まずdeprecateにすべきだろう、という事でblockを渡された場合deprecate messageを出すようにしています。
Merge pull request #26810 from maclover7/jm-fix-26802
actionview/lib/action_view/helpers/url_helper.rb
の修正です。
ActionView::Helpers::UrlHelper#to_form_params
のattribute引数にActionController::Parameters
のインスタンスが渡された場合、Hash
に変換して処理を行うよう修正しています。
button_to
メソッドにActionController::Parameters
を渡した場合に正しくHTMLを生成出来るようにする為、との事です。
Merge pull request #26790 from iainbeeston/type-tests-in-their-own-files
Active Modelのテストの修正です。
ActiveModel::Type
のテストをまとめてactivemodel/test/cases/types_test.rb
で行っていたのを、各type class毎にテストファイルを分けるよう修正しています。