adds scopes for feasible values to spending props

This commit is contained in:
Juanjo Bazán
2016-03-29 13:32:46 +02:00
committed by Juanjo Bazán
parent a14cc1a575
commit 63e8950d6c
4 changed files with 36 additions and 3 deletions

View File

@@ -24,6 +24,9 @@ class SpendingProposal < ActiveRecord::Base
scope :managed, -> { valuation_open.where(valuation_assignments_count: 0).where("administrator_id IS NOT ?", nil) }
scope :valuating, -> { valuation_open.where("valuation_assignments_count > 0 AND valuation_finished = ?", false) }
scope :valuation_finished, -> { where(valuation_finished: true) }
scope :feasible, -> { where(feasible: true) }
scope :unfeasible, -> { where(feasible: false) }
scope :not_unfeasible, -> { where("feasible IS ? OR feasible = ?", nil, true) }
scope :by_admin, -> (admin) { where(administrator_id: admin.presence) }
scope :by_tag, -> (tag_name) { tagged_with(tag_name) }