Merge pull request #1345 from anduong/update_document_for_attribute_method_in_09x_version

Update alias attribute in Readme.md of 0.9.x version
This commit is contained in:
Benjamin Fleischer 2015-12-08 22:25:16 -06:00
commit 1e4eaa1562

View File

@ -339,6 +339,7 @@ And it's also safe to mutate keys argument by doing keys.delete(:author)
in case you want to avoid creating two extra arrays. Note that if you do an
in-place modification, you still need to return the modified array.
### Alias Attribute
If you would like the key in the outputted JSON to be different from its name
in ActiveRecord, you can declare the attribute with the different name
and redefine that method: