Add published_prices? helper method and phases constant at Budget model

This commit is contained in:
Bertocq
2018-01-10 01:15:07 +01:00
parent 3563b87399
commit 21d6ce57c5

View File

@@ -6,6 +6,7 @@ class Budget < ActiveRecord::Base
PHASES = %w(drafting accepting reviewing selecting valuating publishing_prices
balloting reviewing_ballots finished).freeze
ON_HOLD_PHASES = %w(reviewing valuating publishing_prices reviewing_ballots).freeze
PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze
CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze
@@ -82,6 +83,10 @@ class Budget < ActiveRecord::Base
phase == "finished"
end
def published_prices?
PUBLISHED_PRICES_PHASES.include?(phase)
end
def balloting_process?
balloting? || reviewing_ballots?
end