From 9b610049bb4f73dbcdc670879683ec2a1a2ab780 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 5 Sep 2010 21:20:54 -0300 Subject: Cleanup deprecation warnings in active record MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activerecord/lib/active_record/validations.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'activerecord/lib/active_record/validations.rb') diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index b98fd353aa..e4c366ea63 100644 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -53,24 +53,13 @@ module ActiveRecord def valid?(context = nil) context ||= (new_record? ? :create : :update) output = super(context) - - deprecated_callback_method(:validate) - deprecated_callback_method(:"validate_on_#{context}") - errors.empty? && output end protected def perform_validations(options={}) - perform_validation = case options - when Hash - options[:validate] != false - else - ActiveSupport::Deprecation.warn "save(#{options}) is deprecated, please give save(:validate => #{options}) instead", caller - options - end - + perform_validation = options[:validate] != false if perform_validation valid?(options.is_a?(Hash) ? options[:context] : nil) else -- cgit v1.2.3