Add compatible scope to Budget Investment and use it on the winners scope
Why: * Only compatible investments can be winners How: * Using the new column incompatible to filter compatible investments
This commit is contained in:
@@ -50,7 +50,8 @@ class Budget
|
||||
scope :undecided, -> { where(feasibility: "undecided") }
|
||||
scope :with_supports, -> { where('cached_votes_up > 0') }
|
||||
scope :selected, -> { feasible.where(selected: true) }
|
||||
scope :winners, -> { selected.where(winner: true) }
|
||||
scope :compatible, -> { where(incompatible: false) }
|
||||
scope :winners, -> { selected.compatible.where(winner: true) }
|
||||
scope :unselected, -> { not_unfeasible.where(selected: false) }
|
||||
scope :last_week, -> { where("created_at >= ?", 7.days.ago)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user