diff --git a/app/models/cost_scopes.rb b/app/models/cost_scopes.rb index f7e0a6704c..e309ed8bea 100644 --- a/app/models/cost_scopes.rb +++ b/app/models/cost_scopes.rb @@ -3,17 +3,16 @@ module CostScopes base_module.class_eval do def self.extended(base_class) base_class.class_eval do - scope :visible, ->(*args) { - user = args.first || User.current + def self.visible(*args) + user = args.first || User.current with_visible_entries_on self, user: user, project: args[1] - } + end - scope :visible_costs, ->(*args) { + def self.visible_costs(*args) user = args.first || User.current - with_visible_costs_on self, user: user, project: args[1] - } + end end end end