Browse files

ActiveModel#to_xml fix (renamed parameter).

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 20866a5 commit 86a96fb17c28ae460a39cd9747156e82e8cb5f39 @andreas andreas committed with josevalim Sep 2, 2010
Showing with 7 additions and 1 deletion.
  1. +1 −1 activemodel/lib/active_model/serializers/xml.rb
  2. +6 −0 activeresource/test/cases/base_test.rb
View
2 activemodel/lib/active_model/serializers/xml.rb
@@ -17,7 +17,7 @@ class Attribute #:nodoc:
def initialize(name, serializable, raw_value=nil)
@name, @serializable = name, serializable
- @value = value || @serializable.send(name)
+ @value = raw_value || @serializable.send(name)
@type = compute_type
end
View
6 activeresource/test/cases/base_test.rb
@@ -1041,6 +1041,12 @@ def test_to_xml_with_element_name
ensure
Person.element_name = old_elem_name
end
+
+ def test_to_xml_with_private_method_name_as_attribute
+ assert_nothing_raised(ArgumentError) {
+ Customer.new(:test => true).to_xml
+ }
+ end
def test_to_json
Person.include_root_in_json = true

0 comments on commit 86a96fb

Please sign in to comment.