Added proposals phase attributes to legislation processes form

Also added them to the list of accepted params and completed translations.
This commit is contained in:
María Checa
2017-09-13 12:33:16 +02:00
parent bc218531b0
commit dc9fe973f4
5 changed files with 43 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ class Legislation::Process < ActiveRecord::Base
acts_as_paranoid column: :hidden_at
include ActsAsParanoidAliases
PHASES_AND_PUBLICATIONS = %i(debate_phase allegations_phase draft_publication result_publication).freeze
PHASES_AND_PUBLICATIONS = %i(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', dependent: :destroy
@@ -33,6 +33,10 @@ class Legislation::Process < ActiveRecord::Base
Legislation::Process::Phase.new(allegations_start_date, allegations_end_date, allegations_phase_enabled)
end
def proposals_phase
Legislation::Process::Phase.new(proposals_phase_start_date, proposals_phase_end_date, proposals_phase_enabled)
end
def draft_publication
Legislation::Process::Publication.new(draft_publication_date, draft_publication_enabled)
end