2019/02/18分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activemodel/CHANGELOG.md
Fix eager loading polymorphic association with mixed table conditions
Active Recordの修正です。
polymorphic associationが別のtableをjoinするscopeを持っていた場合に、そのassocationをeager loadした際に、foreign_key
とforeign_type
が別のテーブルの条件として扱われてしまう、というバグがあったのを修正しています。
Use placeholder for type_condition
predicate
activerecord/lib/active_record/inheritance.rb
の修正です。
type_condition
でplaceholderを使うよう修正しています。
activesupport/activesupport.gemspec
の修正です。
Zeitwerkのバージョンを1.2.0に更新しています。
Fix type cast with values hash for Date type
Active Modelの修正です。
Date typeのcast
メソッドにHashの値を指定した場合にNameError
が発生してしまうバグがあったのを修正しています。
timezoneの処理に関するメソッドの定義漏れによるエラーで、timezoneに関する処理をhelper moduleに切り出して、それをDate typeでincludeするようにして対応しています。
Remove duplicated test_update_all_with_order_and_limit
activerecord/test/cases/base_test.rb
の修正です。
重複しててあったupdate_all
+ order
+ limit
のテストを削除しています。
Extract duplicated serialize
methods into helpers
Active Modelの修正です。
各type classで内容が重複していたserialize
メソッドをhelperに切り出しています。
Merge pull request #29651 from Sayanc93/return-correct-date
activemodel/lib/active_model/type/date.rb
の修正です。
multiparameter date hashをcastする際に、 グレゴリオ暦の日付からユリウス暦の日付に変換しないように修正しています。yearの値が小さい場合に、dateの値がおかしくなってしまう為。
# before ActiveModel::Type::Date.new.cast({ 1 => 1, 2 => 1, 3 => 1 }) # => Sat, 01 Jan 0001 # after ActiveModel::Type::Date.new.cast({ 1 => 1, 2 => 1, 3 => 1 }) # => Mon, 03 Jan 0001
date_select
でdiscard_year
+ include_blank
を指定した場合year
が1になり、上記問題による影響を受ける為修正を行っています。