Add incompatible scope to Budget Investment model

This commit is contained in:
Bertocq
2017-07-04 01:03:14 +02:00
parent 688ec05ea2
commit 339597483e

View File

@@ -51,6 +51,7 @@ class Budget
scope :with_supports, -> { where('cached_votes_up > 0') }
scope :selected, -> { feasible.where(selected: true) }
scope :compatible, -> { where(incompatible: false) }
scope :incompatible, -> { where(incompatible: true) }
scope :winners, -> { selected.compatible.where(winner: true) }
scope :unselected, -> { not_unfeasible.where(selected: false) }
scope :last_week, -> { where("created_at >= ?", 7.days.ago)}