Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to define custom serializer for given class #813

Merged

Conversation

jtomaszewski
Copy link

.. by defining #serializer_class method in serialized object's class. Resolves #515.

This is a really small fix and has a test - so I don't see any reasons why it shouldn't be merged.

@joshsmith
Copy link
Contributor

I say 👍

@@ -56,7 +56,9 @@ def format_keys(format)
attr_reader :key_format

def serializer_for(resource, options = {})
if resource.respond_to?(:to_ary)
if resource.respond_to?(:serializer_class)
resource.serializer_class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using 2 spaces indentation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed (force pushed a reworked commit)

.. by defining #serializer_class method in serialized object's class. Resolves rails-api#515.
@jtomaszewski jtomaszewski force-pushed the feature/custom-serializer-class branch from 8e6a0e8 to d8b78a3 Compare March 8, 2015 13:59
kurko added a commit that referenced this pull request Mar 9, 2015
…lass

Allow to define custom serializer for given class
@kurko kurko merged commit 55210ab into rails-api:0-9-stable Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants