mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
- Update Readme.md
+ Add ‘Alias Attribute’ anchor link to reference backward from version 0.10.x
This commit is contained in:
parent
dc08f0ec80
commit
8c29719cff
@ -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 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.
|
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
|
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
|
in ActiveRecord, you can declare the attribute with the different name
|
||||||
and redefine that method:
|
and redefine that method:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user