Merge branch 'master' into feature/budget_phases
This commit is contained in:
@@ -29,7 +29,12 @@ class Budget < ActiveRecord::Base
|
||||
scope :balloting, -> { where(phase: "balloting") }
|
||||
scope :reviewing_ballots, -> { where(phase: "reviewing_ballots") }
|
||||
scope :finished, -> { where(phase: "finished") }
|
||||
scope :current, -> { where.not(phase: "finished") }
|
||||
|
||||
scope :open, -> { where.not(phase: "finished") }
|
||||
|
||||
def self.current
|
||||
where.not(phase: "drafting").last
|
||||
end
|
||||
|
||||
def current_phase
|
||||
phases.send(phase)
|
||||
@@ -99,10 +104,6 @@ class Budget < ActiveRecord::Base
|
||||
balloting_process? || finished?
|
||||
end
|
||||
|
||||
def current?
|
||||
!finished?
|
||||
end
|
||||
|
||||
def heading_price(heading)
|
||||
heading_ids.include?(heading.id) ? heading.price : -1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user