diff --git a/app/models/budget.rb b/app/models/budget.rb index 509352372..7fa03db9a 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -3,9 +3,9 @@ class Budget < ActiveRecord::Base include Measurable include Sluggable - PHASES = %w(drafting accepting reviewing selecting valuating balloting - reviewing_ballots finished).freeze - ON_HOLD_PHASES = %w(reviewing valuating reviewing_ballots).freeze + 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 CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze @@ -27,6 +27,7 @@ class Budget < ActiveRecord::Base scope :reviewing, -> { where(phase: "reviewing") } scope :selecting, -> { where(phase: "selecting") } scope :valuating, -> { where(phase: "valuating") } + scope :publishing_prices, -> { where(phase: "publishing_prices") } scope :balloting, -> { where(phase: "balloting") } scope :reviewing_ballots, -> { where(phase: "reviewing_ballots") } scope :finished, -> { where(phase: "finished") } @@ -65,6 +66,10 @@ class Budget < ActiveRecord::Base phase == "valuating" end + def publishing_prices? + phase == "publishing_prices" + end + def balloting? phase == "balloting" end @@ -120,7 +125,7 @@ class Budget < ActiveRecord::Base case phase when 'accepting', 'reviewing' %w{random} - when 'balloting', 'reviewing_ballots' + when 'publishing_prices', 'balloting', 'reviewing_ballots' %w{random price} else %w{random confidence_score} diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml index 5aba444ab..1209d9206 100644 --- a/config/locales/en/budgets.yml +++ b/config/locales/en/budgets.yml @@ -34,6 +34,7 @@ en: reviewing: Reviewing projects selecting: Selecting projects valuating: Valuating projects + publishing_prices: Publishing projects prices balloting: Balloting projects reviewing_ballots: Reviewing Ballots finished: Finished budget diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml index b85f0ec47..bbf668f21 100644 --- a/config/locales/es/budgets.yml +++ b/config/locales/es/budgets.yml @@ -34,6 +34,7 @@ es: reviewing: Revisión interna de proyectos selecting: Fase de apoyos valuating: Evaluación de proyectos + publishing_prices: Publicación de precios balloting: Votación final reviewing_ballots: Votación finalizada finished: Resultados