Skip to content

Commit

Permalink
Remove all deprecation warnings in activeresource
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
carlosantoniodasilva authored and josevalim committed Sep 6, 2010
1 parent 7204bb0 commit a18b73b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
12 changes: 2 additions & 10 deletions activeresource/lib/active_resource/validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,8 @@ module Validations

# 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
Expand Down
8 changes: 0 additions & 8 deletions activeresource/test/cases/validations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ def test_save_without_validation
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')
Expand Down

0 comments on commit a18b73b

Please sign in to comment.