mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Extract attributes filtering from serializer into adapter.
This commit is contained in:
@@ -148,13 +148,8 @@ module ActiveModel
|
||||
root || object.class.model_name.to_s.underscore
|
||||
end
|
||||
|
||||
def attributes(options = {})
|
||||
attributes =
|
||||
if options[:fields]
|
||||
self.class._attributes & options[:fields]
|
||||
else
|
||||
self.class._attributes.dup
|
||||
end
|
||||
def attributes
|
||||
attributes = self.class._attributes.dup
|
||||
|
||||
attributes.each_with_object({}) do |name, hash|
|
||||
unless self.class._fragmented
|
||||
|
||||
Reference in New Issue
Block a user