mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Refactor adapters to implement support for array serialization
This commit is contained in:
@@ -17,13 +17,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def to_json(options = {})
|
||||
result = serializable_hash(options)
|
||||
|
||||
if root = options.fetch(:root, serializer.json_key)
|
||||
result = { root => result }
|
||||
end
|
||||
|
||||
result.to_json
|
||||
serializable_hash(options).to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user