mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Extract attributes filtering from serializer into adapter.
This commit is contained in:
@@ -57,7 +57,10 @@ module ActiveModel
|
||||
|
||||
def resource_object_for(options)
|
||||
cache_check(serializer) do
|
||||
serializer.attributes(options)
|
||||
attributes = serializer.attributes
|
||||
attributes.slice!(*options[:fields]) if options[:fields]
|
||||
|
||||
attributes
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user