Compute only requested attributes.

This commit is contained in:
Lucas Hosseini
2015-10-31 19:20:53 +01:00
parent ecc3b35517
commit 0948c4199a
3 changed files with 5 additions and 10 deletions

View File

@@ -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