mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
remove evals from AM::Validations::Callbacks
follow the same refactor at a63a964a5d
This commit is contained in:
parent
4eedb3928e
commit
5fe43ffcfb
1 changed files with 3 additions and 1 deletions
|
@ -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 a new issue