-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Meta no longer handled in Base adapter. #1695
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ def serializable_hash(*) | |
# links: toplevel_links, | ||
# jsonapi: toplevel_jsonapi | ||
# }.reject! {|_,v| v.nil? } | ||
# rubocop:disable Metrics/CyclomaticComplexity | ||
def success_document | ||
is_collection = serializer.respond_to?(:each) | ||
serializers = is_collection ? serializer : [serializer] | ||
|
@@ -130,8 +131,11 @@ def success_document | |
hash[:links].update(pagination_links_for(serializer)) | ||
end | ||
|
||
hash[:meta] = instance_options[:meta] if instance_options[:meta].is_a?(Hash) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually we kinda want to ensure the value of |
||
|
||
hash | ||
end | ||
# rubocop:enable Metrics/CyclomaticComplexity | ||
|
||
# {http://jsonapi.org/format/#errors JSON API Errors} | ||
# TODO: look into caching | ||
|
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.
alias method should be fine here, unless we want to keep the
root
option here like in the am:s:j in railsThere 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.
It failed because the
alias
would be bound to the pre-inheritance placeholder method.