aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/serializable
diff options
context:
space:
mode:
authorlest <just.lest@gmail.com>2011-11-30 18:47:49 +0300
committerlest <just.lest@gmail.com>2011-11-30 18:57:17 +0300
commit6ce924fa9f8ab2d96d8d78461d9a88aa0e99ec7b (patch)
tree3168f09ecd36514889690db5b30ca989cb53d579 /activemodel/test/cases/serializable
parent93387e2e7c66fb34bde5442ad314c9c63729b75b (diff)
downloadrails-6ce924fa9f8ab2d96d8d78461d9a88aa0e99ec7b.tar.gz
rails-6ce924fa9f8ab2d96d8d78461d9a88aa0e99ec7b.tar.bz2
rails-6ce924fa9f8ab2d96d8d78461d9a88aa0e99ec7b.zip
fix method redefined warning in activemodel
Diffstat (limited to 'activemodel/test/cases/serializable')
-rw-r--r--activemodel/test/cases/serializable/json_test.rb4
-rw-r--r--activemodel/test/cases/serializable/xml_test.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/activemodel/test/cases/serializable/json_test.rb b/activemodel/test/cases/serializable/json_test.rb
index ad5b04091e..e5364d9858 100644
--- a/activemodel/test/cases/serializable/json_test.rb
+++ b/activemodel/test/cases/serializable/json_test.rb
@@ -14,9 +14,11 @@ class Contact
end
end
+ remove_method :attributes if method_defined?(:attributes)
+
def attributes
instance_values
- end unless method_defined?(:attributes)
+ end
end
class JsonSerializationTest < ActiveModel::TestCase
diff --git a/activemodel/test/cases/serializable/xml_test.rb b/activemodel/test/cases/serializable/xml_test.rb
index 817ca1e736..834c4de1e1 100644
--- a/activemodel/test/cases/serializable/xml_test.rb
+++ b/activemodel/test/cases/serializable/xml_test.rb
@@ -9,6 +9,8 @@ class Contact
attr_accessor :address, :friends
+ remove_method :attributes if method_defined?(:attributes)
+
def attributes
instance_values.except("address", "friends")
end