From 15c49e0c10dae0238548489de92189953ebd2bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 11 Oct 2019 02:31:50 +0200 Subject: [PATCH] Remove obsolete URL helpers We now use `polymorphic_hierarchy_path` instead. --- app/controllers/comments_controller.rb | 4 +--- app/controllers/notifications_controller.rb | 2 -- app/helpers/custom_urls_helper.rb | 9 --------- 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 app/helpers/custom_urls_helper.rb diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 6504c3f27..7bb5b126a 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,6 +1,4 @@ class CommentsController < ApplicationController - include CustomUrlsHelper - before_action :authenticate_user!, only: :create before_action :load_commentable, only: :create before_action :verify_resident_for_commentable!, only: :create @@ -104,7 +102,7 @@ class CommentsController < ApplicationController return if current_user.administrator? || current_user.moderator? if @commentable.respond_to?(:comments_closed?) && @commentable.comments_closed? - redirect_to @commentable, alert: t("comments.comments_closed") + redirect_to polymorphic_hierarchy_path(@commentable), alert: t("comments.comments_closed") end end diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index e2293f2c3..ce257ae7d 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -1,6 +1,4 @@ class NotificationsController < ApplicationController - include CustomUrlsHelper - before_action :authenticate_user! skip_authorization_check diff --git a/app/helpers/custom_urls_helper.rb b/app/helpers/custom_urls_helper.rb deleted file mode 100644 index 1519e771e..000000000 --- a/app/helpers/custom_urls_helper.rb +++ /dev/null @@ -1,9 +0,0 @@ -module CustomUrlsHelper - def legislation_question_url(question) - legislation_process_question_url(question.process, question) - end - - def legislation_annotation_url(annotation) - legislation_process_question_url(annotation.draft_version.process, annotation.draft_version, annotation) - end -end