mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06:50 +00:00
parent
5cb0875286
commit
3c124e8ce5
@ -68,9 +68,11 @@ $ rails g serializer post
|
|||||||
|
|
||||||
### Support for POROs
|
### Support for POROs
|
||||||
|
|
||||||
Currently `ActiveModel::Serializers` expects objects to implement
|
The PORO should include ActiveModel::SerializerSupport. That's all you need to
|
||||||
read\_attribute\_for\_serialization. That's all you need to do to have
|
do to have your POROs supported.
|
||||||
your POROs supported.
|
|
||||||
|
For Rails versions before Rails 4 ActiveModel::Serializers expects objects to
|
||||||
|
implement `read_attribute_for_serialization`.
|
||||||
|
|
||||||
# render :json
|
# render :json
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user