Root is always "data" for jsonapi

This commit is contained in:
Mateo Murphy 2015-03-18 15:01:50 -04:00
parent b68d7f4826
commit 3ba4386bda

View File

@ -16,7 +16,7 @@ module ActiveModel
end end
def serializable_hash(options = {}) def serializable_hash(options = {})
@root = (@options[:root] || serializer.json_key.to_s.pluralize).to_sym @root = 'data'
if serializer.respond_to?(:each) if serializer.respond_to?(:each)
@hash[@root] = serializer.map do |s| @hash[@root] = serializer.map do |s|