From a18b73b43c07d031c9a660bc119835dcb6db85cf Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 5 Sep 2010 14:59:58 -0300 Subject: Remove all deprecation warnings in activeresource MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activeresource/lib/active_resource/validations.rb | 12 ++---------- activeresource/test/cases/validations_test.rb | 8 -------- 2 files changed, 2 insertions(+), 18 deletions(-) (limited to 'activeresource') diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb index adceac2f61..d3b19ee560 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -68,16 +68,8 @@ module ActiveResource # Validate a resource and save (POST) it to the remote web service. # If any local validations fail - the save (POST) will not be attempted. - def save_with_validation(options=nil) - perform_validation = case options - when Hash - options[:validate] != false - when NilClass - true - else - ActiveSupport::Deprecation.warn "save(#{options}) is deprecated, please give save(:validate => #{options}) instead", caller - options - end + def save_with_validation(options={}) + perform_validation = options[:validate] != false # clear the remote validations so they don't interfere with the local # ones. Otherwise we get an endless loop and can never change the diff --git a/activeresource/test/cases/validations_test.rb b/activeresource/test/cases/validations_test.rb index 87c5c8c611..bd79fdd952 100644 --- a/activeresource/test/cases/validations_test.rb +++ b/activeresource/test/cases/validations_test.rb @@ -36,14 +36,6 @@ class ValidationsTest < ActiveModel::TestCase assert p.save(:validate => false) end - def test_deprecated_save_without_validation - p = new_project(:name => nil) - assert !p.save - assert_deprecated do - assert p.save(false) - end - end - def test_validate_callback # we have a callback ensuring the description is longer than three letters p = new_project(:description => 'a') -- cgit v1.2.3