mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
First try to implement ArraySerializer
This commit is contained in:
@@ -108,12 +108,7 @@ module ActiveModel
|
||||
self.class._associations.dup.each_with_object({}) do |(name, value), hash|
|
||||
association = object.send(name)
|
||||
serializer_class = ActiveModel::Serializer.serializer_for(association)
|
||||
if serializer_class
|
||||
serializer = serializer_class.new(association)
|
||||
hash[name] = serializer
|
||||
else
|
||||
hash[name] = association
|
||||
end
|
||||
hash[name] = serializer_class.new(association)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user