mirror of https://github.com/rails/rails
remove evals from AM::Validations::Callbacks
follow the same refactor at a63a964a5d
This commit is contained in:
parent
4eedb3928e
commit
5fe43ffcfb
|
@ -58,7 +58,9 @@ module ActiveModel
|
|||
if options.is_a?(Hash) && options[:on]
|
||||
options[:if] = Array(options[:if])
|
||||
options[:on] = Array(options[:on])
|
||||
options[:if].unshift("#{options[:on]}.include? self.validation_context")
|
||||
options[:if].unshift lambda { |o|
|
||||
options[:on].include? o.validation_context
|
||||
}
|
||||
end
|
||||
set_callback(:validation, :before, *args, &block)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue