select less data

This commit is contained in:
Sam 2015-08-05 16:09:10 +10:00
parent a51386a280
commit 4486879fd2

View File

@ -91,7 +91,9 @@ module HasCustomFields
fk = (name.underscore << "_id")
"#{name}CustomField".constantize.where("#{fk} in (?)", map.keys)
"#{name}CustomField".constantize
.where("#{fk} in (?)", map.keys)
.where("name in (?)", fields)
.pluck(fk, :name, :value).each do |id, name, value|
preloaded = map[id].preloaded_custom_fields