Fix a couple of mistaken deprecation solutions

This commit is contained in:
wycats
2010-08-03 12:50:13 -07:00
parent 84703be5ff
commit 146a013c42
2 changed files with 3 additions and 3 deletions

View File

@@ -135,7 +135,7 @@ module ActiveModel
ActiveSupport::Deprecation.warn(msg, caller)
options = args.extract_options!
options[:on] = :#{type}
validate(args.push(options), &block)
validate(*args.push(options), &block)
end
RUBY
end

View File

@@ -28,7 +28,7 @@ module ActiveModel
module ClassMethods
def before_validation(*args, &block)
options = args.last
options = args.extract_options!
if options.is_a?(Hash) && options[:on]
options[:if] = Array.wrap(options[:if])
options[:if] << "self.validation_context == :#{options[:on]}"
@@ -53,7 +53,7 @@ module ActiveModel
ActiveSupport::Deprecation.warn(msg, caller)
options = args.extract_options!
options[:on] = :#{on}
before_validation(args.push(options), &block)
before_validation(*args.push(options), &block)
end
RUBY
end