-
Notifications
You must be signed in to change notification settings - Fork 68
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
Implement support for collection serializers. #61
Conversation
serializer_class = resource_defined_class | ||
serializer_class ||= collection_class | ||
serializer_class ||= options[:serializer] | ||
@serializer_class ||= ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this even valid Ruby? ;)
I think it should be
serializer_class ||= begin
...
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better:
return if @serializer_class
@serialiazer_class = resource_defined_class
@serialiazer_class ||= collection_class
@serialiazer_class ...
Needs CHANGELOG too I believe. I am afraid I don't know more about your question ;( |
48505eb
to
af3ccab
Compare
@dblock - Thanks for the comments! I've addressed them, updated the changelog with whatever pulls were missing, and updated the pull. |
end | ||
|
||
private | ||
|
||
attr_accessor :resource, :options | ||
|
||
def serializer_class | ||
return @serializer_class if defined?(@serializer_class) | ||
serializer_class = resource_defined_class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you just use @serializer_class
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, ill switch to that
More questions, but this is very close to merging. |
af3ccab
to
6bb2057
Compare
@dblock - Updated addressing your comments! Thanks again |
Merged, thanks for hanging in here! |
Cool, no prob. Thanks for the merge! |
The implements support for
namespace
andversion
serializer resolution in collection serializers.@dblock if you have any knowledge of how asm handles the each_serializer option, that would be great info, but using the serializer option is the only way I've gotten it to work. I tried passing the each_serializer options around as both an adapter and a serializer option, but have run into issues with both.