diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-03-20 18:51:01 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-20 18:51:01 +0000 |
commit | 09afbfd47f8180bb6d5f907abdeab6badeda879e (patch) | |
tree | 7a5451e05044ab8a0be6dbc4903d764b180ca203 /activeresource | |
parent | bc1dd0b82eb994a9948c038e01db7ced5a48ffea (diff) | |
download | rails-09afbfd47f8180bb6d5f907abdeab6badeda879e.tar.gz rails-09afbfd47f8180bb6d5f907abdeab6badeda879e.tar.bz2 rails-09afbfd47f8180bb6d5f907abdeab6badeda879e.zip |
Fix ActiveResource::Errors deprecation messages
Diffstat (limited to 'activeresource')
-rw-r--r-- | activeresource/lib/active_resource/validations.rb | 4 | ||||
-rw-r--r-- | activeresource/test/base_errors_test.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb index ca01ed3c75..7fe3162c02 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -4,7 +4,7 @@ module ActiveResource # Active Resource validation is reported to and from this object, which is used by Base#save # to determine whether the object in a valid state to be saved. See usage example in Validations. - class Errors < ::ActiveModel::Errors + class Errors < ActiveModel::Errors # Grabs errors from the XML response. def from_xml(xml) clear @@ -38,7 +38,7 @@ module ActiveResource # person.errors.empty? # => false # person.errors.count # => 1 # person.errors.full_messages # => ["Last name can't be empty"] - # person.errors.on(:last_name) # => "can't be empty" + # person.errors[:last_name] # => ["can't be empty"] # person.last_name = "Halpert" # person.save # => true (and person is now saved to the remote service) # diff --git a/activeresource/test/base_errors_test.rb b/activeresource/test/base_errors_test.rb index 517babd16b..8c177c8006 100644 --- a/activeresource/test/base_errors_test.rb +++ b/activeresource/test/base_errors_test.rb @@ -21,9 +21,9 @@ class BaseErrorsTest < Test::Unit::TestCase def test_should_parse_errors_to_individual_attributes assert @person.errors.invalid?(:name) - assert_equal "can't be blank", @person.errors.on(:age) + assert_equal ["can't be blank"], @person.errors[:age] assert_equal ["can't be blank", "must start with a letter"], @person.errors[:name] - assert_equal "Person quota full for today.", @person.errors.on_base + assert_equal ["Person quota full for today."], @person.errors[:base] end def test_should_iterate_over_errors |