Apply Rails/RequestReferer rubocop rule
This commit is contained in:
@@ -150,9 +150,6 @@ Rails/ReadWriteAttribute:
|
|||||||
Rails/RedundantReceiverInWithOptions:
|
Rails/RedundantReceiverInWithOptions:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Rails/RequestReferer:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Rails/ReversibleMigration:
|
Rails/ReversibleMigration:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,9 @@ Rails/Presence:
|
|||||||
Rails/RelativeDateConstant:
|
Rails/RelativeDateConstant:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Rails/RequestReferer:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Rails/TimeZone:
|
Rails/TimeZone:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Admin::Legislation::HomepagesController < Admin::Legislation::BaseControll
|
|||||||
def update
|
def update
|
||||||
if @process.update(process_params)
|
if @process.update(process_params)
|
||||||
link = legislation_process_path(@process).html_safe
|
link = legislation_process_path(@process).html_safe
|
||||||
redirect_back(fallback_location: (request.referrer || root_path),
|
redirect_back(fallback_location: (request.referer || root_path),
|
||||||
notice: t("admin.legislation.processes.update.notice", link: link))
|
notice: t("admin.legislation.processes.update.notice", link: link))
|
||||||
else
|
else
|
||||||
flash.now[:error] = t("admin.legislation.processes.update.error")
|
flash.now[:error] = t("admin.legislation.processes.update.error")
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll
|
|||||||
set_tag_list
|
set_tag_list
|
||||||
|
|
||||||
link = legislation_process_path(@process).html_safe
|
link = legislation_process_path(@process).html_safe
|
||||||
redirect_back(fallback_location: (request.referrer || root_path),
|
redirect_back(fallback_location: (request.referer || root_path),
|
||||||
notice: t("admin.legislation.processes.update.notice", link: link))
|
notice: t("admin.legislation.processes.update.notice", link: link))
|
||||||
else
|
else
|
||||||
flash.now[:error] = t("admin.legislation.processes.update.error")
|
flash.now[:error] = t("admin.legislation.processes.update.error")
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseContr
|
|||||||
else
|
else
|
||||||
t("flash.actions.destroy.error")
|
t("flash.actions.destroy.error")
|
||||||
end
|
end
|
||||||
redirect_back(fallback_location: (request.referrer || root_path), notice: notice)
|
redirect_back(fallback_location: (request.referer || root_path), notice: notice)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user