Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
to_xml should also rely on serializable hash.
- Loading branch information
Showing
3 changed files
with
33 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51bef9d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
This commit has broken a test.
test_to_xml_with_private_method_name_as_attribute(BaseTest) [/home/shikeb/rails/activeresource/test/cases/base_test.rb:1007]:
Exception raised:
ArgumentError: wrong number of arguments (0 for 2..3).
289 tests, 892 assertions, 1 failures, 0 errors, 0 skips
Test run options: --seed 46552
Thanks.
cc @josevalim @spastorino
51bef9d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josevalim I have fixed this in a15424b, please could you check that you are happy with the fix?
51bef9d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
51bef9d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree with you. I also think that our reliance on
method_missing
is a bit problematic, for example consider this:It's not straightforward to avoid though. For example, in Active Record you can "piggyback" attributes onto a model:
Person.select("people.*, 'foo' as bar")
- this either requires usingmethod_missing
, or adding instance-specific behaviour, which is very slow as it requires creating a singleton class.