2017/01/15分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
type_condition should be overwritten by create_with_value in scope_for_create
activerecord/lib/active_record/core.rbの修正です。
relationを生成する際に、type_conditionがcreate_with_valueの値を上書き出来るよう、keyの型を合わすよう修正しています。
- relation.where(type_condition).create_with(inheritance_column.to_sym => sti_name) + relation.where(type_condition).create_with(inheritance_column.to_s => sti_name)
STIを使用している場合に、type keyの型が合わず、scope_for_createの結果にtypeが2つ含まれてしまう(keyがStringのtypeとkeyがSymbolのtype)という問題があった為修正したようです。
AS::ArrayInquirer#respond_to_missing? should fallback to super
activesupport/lib/active_support/array_inquirer.rbの修正です。
ActiveSupport::ArrayInquirer#respond_to_missing?メソッドでArrayInquirerが対応しないメソッド名が指定された場合、親クラスにフォールバックするよう修正しています。
def respond_to_missing?(name, include_private = false) - name[-1] == "?" + (name[-1] == "?") || super end
activesupport/lib/active_support/array_inquirer.rbの修正です。
ActiveSupport::ArrayInquirer#any?メソッドの引数から使用していない&blockパラメータを削除しています。
Merge pull request #27660 from akihiro17/updates-timestamp
activerecord/lib/active_record/counter_cache.rb、
activerecord/lib/active_record/persistence.rbの修正です。
ActiveRecord#increment!、#decrement!メソッドの引数にtimestamp columnsを更新するかどうかを指定する為のtouchオプションを追加しています。
This test wasn't actually an effective regression test
activesupport/test/array_inquirer_test.rbの修正です。
先ほどコミットされた、ActiveSupport::ArrayInquirer#respond_to_missing?メソッドでArrayInquirerが対応しないメソッド名が指定された場合に親クラスにフォールバックするよう修正した対応のテストを修正しています。最初コミットされたテストは正しくテストが行われていなかった為、のようです。
AS::StringInquirer#respond_to_missing? should fallback to super
activesupport/lib/active_support/string_inquirer.rbの修正です。
ActiveSupport::StringInquirer#respond_to_missing?メソッドでStringInquirerが対応しないメソッド名が指定された場合、親クラスにフォールバックするよう修正しています。
respond_to_missing? should fallback to super where method_missing could call super
actionmailer/lib/action_mailer/base.rb、
actionpack/lib/action_dispatch/http/mime_type.rbの修正です。
ActionMailer::Base#respond_to_missing?、Mime::Mimes::Type#respond_to_missing?それぞれのメソッドで、対応しないメソッド名が指定された場合、親クラスにフォールバックするよう修正しています。
It would be safer not to totally undef core classes' respond_to_missing?
activesupport/test/array_inquirer_test.rb、
activesupport/test/string_inquirer_test.rbの修正です。
ArrayInquirer#respond_to_missing?、StringInquirer#respond_to_missing?が親クラスにフォールバックする事を確認するテストで、テストの後処理でrespond_to_missing?をundefしていたのを、何もしないメソッドを再定義するよう修正しています。
- Array.send :undef_method, :respond_to_missing? + Array.class_eval do + undef_method :respond_to_missing? + def respond_to_missing?(name, include_private = false) + super + end + end
こちらの方が安全だから、という理由の事です。StringInquirerクラスの方のrespond_to_missing?メソッドに微妙に処理が入っているのか意図的なのかなあ。
ZOMG worst typo in my life :scream:
actionmailer/lib/action_mailer/base.rbの修正です。
先ほどの#respond_to_missing?メソッドの対応でsuperと書くべきところを、selfにタイポしていたのを修正しています。
Several representation of BigDecimal has changed in Ruby 2.4.0+ [ci skip]
activesupport/lib/active_support/core_ext/object/duplicable.rbのdoc、及びRails guideのActive Support Core Extensionsの修正です。
BigDecimalのexampleコードを表示している箇所に、Ruby 2.4.0の場合の出力例を追加しています。
# In Ruby 2.4.0: BigDecimal.new("1.2").dup # => 0.12e1 # Whereas in Ruby 2.2 and 2.3: BigDecimal.new("1.2").dup # => #<BigDecimal:...,'0.12E1',18(18)>
Ruby 2.4.0だとinspectの結果違うんですねえ。
が、2つの例を追加すると混乱する可能性がある、かつ、rails masterはRuby 2.2.2をサポートしている為、後ほどrevertされています。
remove unnecessary addition of lib
railties/lib/rails/generators/rails/plugin/plugin_generator.rbの修正です。
plugin generatorが生成するRakefile内のRake::TestTaskのinitialize処理から、libs変数にlibを追加する処理を削除しています。libs変数にはデフォルトでlibが追加されており、明示的に追加する必要は無い為。
Fix broken sample code in action_view/helpers/output_safety_helper.rb [ci skip]
actionview/lib/action_view/helpers/output_safety_helper.rbのdocの修正です。
safe_joinメソッド内のexampleコードに閉じ括弧が不足していたのを追加しています。
activejob/lib/active_job/queue_adapter.rbの修正です。
使用していないrequireを削除しています。
Allow render locals to be assigned to instance variables
actionview/lib/action_view/template.rbの修正です。
renderメソッドのlocalsオプションにインスタンス変数が指定出来なくなってしまっていたのを、再度指定出来るよう修正しています。
render(file: "test/render_file_instance_variable", locals: { "@foo": "bar" }
Rails 5.0.1で発生したバグ。
Gemfile、Gemfile.lockの修正です。mocha gemのバージョンを1.2.1に更新しています。
が、Active Recordのテストがコケてしまうようになった為、後ほどrevertされています。