diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index d7ad6cf62..0370d8913 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -20,19 +20,21 @@ class Legislation::Process < ActiveRecord::Base scope :past, -> { where("end_date < ?", Date.current).order('id DESC') } def debate_phase - Legislation::Process::Phase.new(debate_start_date, debate_end_date) + Legislation::Process::Phase.new(debate_start_date, debate_end_date, debate_phase_enabled) end def allegations_phase - Legislation::Process::Phase.new(allegations_start_date, allegations_end_date) + Legislation::Process::Phase.new(allegations_start_date, allegations_end_date, allegations_phase_enabled) end def draft_publication - Legislation::Process::Publication.new(draft_publication_date) + Legislation::Process::Publication.new(draft_publication_date, draft_publication_enabled) end def result_publication - Legislation::Process::Publication.new(result_publication_date) + Legislation::Process::Publication.new(result_publication_date, result_publication_enabled) + end + end def total_comments diff --git a/app/models/legislation/process/phase.rb b/app/models/legislation/process/phase.rb index 1b8482a9a..5d677251d 100644 --- a/app/models/legislation/process/phase.rb +++ b/app/models/legislation/process/phase.rb @@ -2,13 +2,14 @@ class Legislation::Process::Phase - def initialize(start_date, end_date) + def initialize(start_date, end_date, enabled) @start_date = start_date @end_date = end_date + @enabled = enabled end def enabled? - @start_date.present? && @end_date.present? + @enabled end def started? diff --git a/app/models/legislation/process/publication.rb b/app/models/legislation/process/publication.rb index 10110f0e7..650914f95 100644 --- a/app/models/legislation/process/publication.rb +++ b/app/models/legislation/process/publication.rb @@ -2,12 +2,13 @@ class Legislation::Process::Publication - def initialize(publication_date) + def initialize(publication_date, enabled) @publication_date = publication_date + @enabled = enabled end def enabled? - @publication_date.present? + @enabled end def started?