diff --git a/app/controllers/legislation/annotations_controller.rb b/app/controllers/legislation/annotations_controller.rb index dc3ff4834..56f851316 100644 --- a/app/controllers/legislation/annotations_controller.rb +++ b/app/controllers/legislation/annotations_controller.rb @@ -29,7 +29,7 @@ class Legislation::AnnotationsController < ApplicationController end def create - if !@process.open_phase?(:allegations) || @draft_version.final_version? + if !@process.allegations_phase.open? || @draft_version.final_version? render json: {}, status: :not_found and return end diff --git a/app/controllers/legislation/answers_controller.rb b/app/controllers/legislation/answers_controller.rb index 372398e41..6d3c33580 100644 --- a/app/controllers/legislation/answers_controller.rb +++ b/app/controllers/legislation/answers_controller.rb @@ -9,7 +9,7 @@ class Legislation::AnswersController < Legislation::BaseController respond_to :html, :js def create - if @process.open_phase?(:debate) + if @process.debate_phase.open? @answer.user = current_user @answer.save track_event diff --git a/app/models/legislation/question.rb b/app/models/legislation/question.rb index 374c43eb5..4381b752a 100644 --- a/app/models/legislation/question.rb +++ b/app/models/legislation/question.rb @@ -37,6 +37,6 @@ class Legislation::Question < ActiveRecord::Base end def comments_open? - process.open_phase?(:debate) + process.debate_phase.open? end end diff --git a/app/views/legislation/annotations/_comments_box.html.erb b/app/views/legislation/annotations/_comments_box.html.erb index 79fdbef4b..d76d273c1 100644 --- a/app/views/legislation/annotations/_comments_box.html.erb +++ b/app/views/legislation/annotations/_comments_box.html.erb @@ -15,12 +15,12 @@ <% end %> <% end %> - <% if @process.open_phase?(:allegations) %> + <% if @process.allegations_phase.open? %> <%= t('legislation.annotations.comments.publish_comment') %>   <% end %> - <% if @process.open_phase?(:allegations) %> + <% if @process.allegations_phase.open? %> <% if user_signed_in? %> <% css_id = parent_or_commentable_dom_id(nil, annotation) %>