mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Root is always "data" for jsonapi
This commit is contained in:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user