Add missing references to BudgetItem scopes

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/6827/head
Alex Coles 9 years ago
parent 88715c2021
commit 7cafbfd2a4
  1. 1
      app/models/labor_budget_item.rb
  2. 1
      app/models/material_budget_item.rb

@ -42,6 +42,7 @@ class LaborBudgetItem < ActiveRecord::Base
scope :visible_costs, lambda{|*args| scope :visible_costs, lambda{|*args|
includes([{ cost_object: :project }, :user]) includes([{ cost_object: :project }, :user])
.where(LaborBudgetItem.visible_condition((args.first || User.current), args[1])) .where(LaborBudgetItem.visible_condition((args.first || User.current), args[1]))
.references(:projects)
} }
def costs def costs

@ -35,6 +35,7 @@ class MaterialBudgetItem < ActiveRecord::Base
scope :visible_costs, lambda { |*args| scope :visible_costs, lambda { |*args|
where(MaterialBudgetItem.visible_condition((args.first || User.current), args[1])) where(MaterialBudgetItem.visible_condition((args.first || User.current), args[1]))
.includes(cost_object: :project) .includes(cost_object: :project)
.references(:projects)
} }
def costs def costs

Loading…
Cancel
Save