Remove obsolete URL helpers

We now use `polymorphic_hierarchy_path` instead.
This commit is contained in:
Javi Martín
2019-10-11 02:31:50 +02:00
parent bb627a7117
commit 15c49e0c10
3 changed files with 1 additions and 14 deletions

View File

@@ -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

View File

@@ -1,6 +1,4 @@
class NotificationsController < ApplicationController
include CustomUrlsHelper
before_action :authenticate_user!
skip_authorization_check

View File

@@ -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