From 7cafbfd2a439daba0c8b13368e96fd860029790a Mon Sep 17 00:00:00 2001 From: Alex Coles Date: Sun, 30 Aug 2015 10:27:34 +0200 Subject: [PATCH] Add missing references to BudgetItem scopes Signed-off-by: Alex Coles --- app/models/labor_budget_item.rb | 1 + app/models/material_budget_item.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/labor_budget_item.rb b/app/models/labor_budget_item.rb index 1aee14fb85..dcc3921ea9 100644 --- a/app/models/labor_budget_item.rb +++ b/app/models/labor_budget_item.rb @@ -42,6 +42,7 @@ class LaborBudgetItem < ActiveRecord::Base scope :visible_costs, lambda{|*args| includes([{ cost_object: :project }, :user]) .where(LaborBudgetItem.visible_condition((args.first || User.current), args[1])) + .references(:projects) } def costs diff --git a/app/models/material_budget_item.rb b/app/models/material_budget_item.rb index b3eeaf452f..d29c4cb5ad 100644 --- a/app/models/material_budget_item.rb +++ b/app/models/material_budget_item.rb @@ -35,6 +35,7 @@ class MaterialBudgetItem < ActiveRecord::Base scope :visible_costs, lambda { |*args| where(MaterialBudgetItem.visible_condition((args.first || User.current), args[1])) .includes(cost_object: :project) + .references(:projects) } def costs