1
0
Fork 0
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:
Steven Yang 2013-06-30 18:47:55 +08:00
parent 4eedb3928e
commit 5fe43ffcfb

View file

@ -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