Created
March 1, 2016 01:02
-
-
Save Killavus/adc0637872b3678dd752 to your computer and use it in GitHub Desktop.
Base Serializer
This file contains hidden or 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
| class BaseSerializer | |
| def serialize_relationship(name, collection) | |
| collection.map do |rel| | |
| { id: rel.id, type: name } | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment