When you set a value for after (or any other comparison option) with a Proc object, the value appearing in error details is an inspect of the Proc itself instead of being the result of Proc.call
Steps to reproduce
How can we reproduce the bug? Example:
class Model
validates :date_field, { after: Proc.new { Time.now } }
end
m = Model.new
m.valid?
puts m.errors.details[:date_field}
# => { ..., after: #<Proc:0x0000... > }
Current Behavior
Which broken behavior are you experiencing?
String dump of Proc value from options
Expected behavior
We should have the actual value returned by Proc.call
Input Code
see above
Environment
Env doesnt matter for this issue
Possible Solution
add option_value in ***options.merge() in validations/date_validator.rb
🐞 Bug Report
When you set a value for
after
(or any other comparison option) with aProc
object, the value appearing in error details is an inspect of theProc
itself instead of being the result ofProc.call
Steps to reproduce
How can we reproduce the bug? Example:
Current Behavior
Which broken behavior are you experiencing?
String dump of Proc value from options
Expected behavior
We should have the actual value returned by
Proc.call
Input Code
see above
Environment
Env doesnt matter for this issue
Possible Solution
add
option_value
in***options.merge()
invalidations/date_validator.rb