mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Compute only requested attributes.
This commit is contained in:
@@ -57,10 +57,7 @@ module ActiveModel
|
||||
|
||||
def resource_object_for(options)
|
||||
cache_check(serializer) do
|
||||
attributes = serializer.attributes
|
||||
attributes.slice!(*options[:fields]) if options[:fields]
|
||||
|
||||
attributes
|
||||
serializer.attributes(options[:fields])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user