mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
checking proc arity in option value for ruby 1.9 compat
This commit is contained in:
parent
e399c6b510
commit
2028d68b17
@ -185,7 +185,8 @@ module ValidatesTimeliness
|
||||
when Symbol
|
||||
evaluate_option_value(record.send(value), type, record)
|
||||
when Proc
|
||||
evaluate_option_value(value.call(record), type, record)
|
||||
result = value.arity > 0 ? value.call(record) : value.call
|
||||
evaluate_option_value(result, type, record)
|
||||
when Array
|
||||
value.map {|r| evaluate_option_value(r, type, record) }.sort
|
||||
when Range
|
||||
|
||||
Loading…
Reference in New Issue
Block a user