Skip to content

Commit

Permalink
ActiveModel#to_xml fix (renamed parameter).
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
andreas authored and josevalim committed Sep 2, 2010
1 parent b8f3b26 commit 1503e45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/serializers/xml.rb
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions activeresource/test/cases/base_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 1503e45

Please sign in to comment.