Permalink
Browse files

ActiveModel#to_xml fix (renamed parameter).

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent b8f3b26 commit 1503e45e2e2de8314429d3e3006bd49c0c4a11d6 @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
@@ -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
@@ -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 1503e45

Please sign in to comment.