Add published_prices? helper method and phases constant at Budget model
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user