We don't implement much custom marshalling logic for these objects, but the proc default case needs to be handled separately. Unfortunately there's no way to just say "do what you would have done but with this value for one ivar", so we have to manually implement `marshal_load` as well. The test case is a little bit funky, but I'd really like an equality test in there, and there's no easy way to add one now that this is out of AR (since the `attributes` method isn't here) Fixes #31216
1.7 KiB
-
Models using the attributes API with a proc default can now be marshalled.
Fixes #31216.
Sean Griffin
-
Fix to working before/after validation callbacks on multiple contexts.
Yoshiyuki Hirano
Rails 5.2.0.beta2 (November 28, 2017)
- No changes.
Rails 5.2.0.beta1 (November 27, 2017)
-
Execute
ConfirmationValidator
validation when_confirmation
's value isfalse
.bogdanvlviv
-
Allow passing a Proc or Symbol to length validator options.
Matt Rohrer
-
Add method
#merge!
forActiveModel::Errors
.Jahfer Husain
-
Fix regression in numericality validator when comparing Decimal and Float input values with more scale than the schema.
Bradley Priest
-
Fix methods
#keys
,#values
inActiveModel::Errors
.Change
#keys
to only return the keys that don't have empty messages.Change
#values
to only return the not empty values.Example:
# Before person = Person.new person.errors.keys # => [] person.errors.values # => [] person.errors.messages # => {} person.errors[:name] # => [] person.errors.messages # => {:name => []} person.errors.keys # => [:name] person.errors.values # => [[]] # After person = Person.new person.errors.keys # => [] person.errors.values # => [] person.errors.messages # => {} person.errors[:name] # => [] person.errors.messages # => {:name => []} person.errors.keys # => [] person.errors.values # => []
bogdanvlviv
Please check 5-1-stable for previous changes.