mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Root is always "data" for jsonapi
This commit is contained in:
parent
b68d7f4826
commit
3ba4386bda
@ -16,7 +16,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def serializable_hash(options = {})
|
||||
@root = (@options[:root] || serializer.json_key.to_s.pluralize).to_sym
|
||||
@root = 'data'
|
||||
|
||||
if serializer.respond_to?(:each)
|
||||
@hash[@root] = serializer.map do |s|
|
||||
|
||||
Loading…
Reference in New Issue
Block a user