diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index be8cc74c3..dc880552b 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -18,8 +18,8 @@ class Legislation::Process < ActiveRecord::Base translates :homepage, touch: true include Globalizable - PHASES_AND_PUBLICATIONS = %i[draft_phase debate_phase allegations_phase proposals_phase - draft_publication result_publication].freeze + PHASES_AND_PUBLICATIONS = %i[homepage_phase draft_phase debate_phase allegations_phase + proposals_phase draft_publication result_publication].freeze has_many :draft_versions, -> { order(:id) }, class_name: 'Legislation::DraftVersion', foreign_key: 'legislation_process_id', @@ -54,6 +54,10 @@ class Legislation::Process < ActiveRecord::Base draft_end_date IS NOT NULL and (draft_start_date > ? or draft_end_date < ?))", Date.current, Date.current) } + def homepage_phase + Legislation::Process::Phase.new(start_date, end_date, homepage_enabled) + end + def draft_phase Legislation::Process::Phase.new(draft_start_date, draft_end_date, draft_phase_enabled) end diff --git a/app/views/legislation/processes/_key_dates.html.erb b/app/views/legislation/processes/_key_dates.html.erb index 7181e68cf..b10fdb32c 100644 --- a/app/views/legislation/processes/_key_dates.html.erb +++ b/app/views/legislation/processes/_key_dates.html.erb @@ -6,6 +6,15 @@ <% end %>