1
0

Query optimizations

This commit is contained in:
cryptogopher
2020-03-24 22:16:27 +01:00
parent 63370ccc1a
commit 08860cbfab
3 changed files with 3 additions and 4 deletions

View File

@@ -43,8 +43,7 @@ class Formula < ActiveRecord::Base
errors = parser.errors
quantities = Quantity.where(project: self.quantity.project, name: identifiers)
quantities_names = quantities.pluck(:name)
(identifiers - quantities_names).each do |q|
(identifiers - quantities.map(&:name)).each do |q|
errors << [:unknown_quantity, {quantity: q}]
end