Fix overridden scopes (#299)

[ci skip]
pull/6827/head
Oliver Günther 7 years ago committed by GitHub
parent 94ed61fe6a
commit 9050c8bb4f
  1. 11
      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

Loading…
Cancel
Save