From fe571d1d14574bb08e05494fb52542c256a976d6 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 23 Sep 2020 18:19:39 +0100 Subject: [PATCH] remove redundant method and global variable from controller --- app/controllers/application_controller.rb | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 85325ddda..3740d1485 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -14,15 +14,6 @@ class PageNotFound < StandardError; end; before_action :set_locale before_action :check_for_pdf - after_action :store_location - - NO_REDIRECT = ["/users/sign_in", - "/users/sign_up", - "/users/password/new", - "/users/password/edit", - "/users/confirmation", - "/users/sign_out" - ].freeze def admin_path? request.original_fullpath =~ %r{/(?:#{I18n.locale}/)?admin/?} @@ -128,15 +119,6 @@ def check_for_pdf @for_pdf = params[:for_pdf].present? end - def store_location - # store last url - this is needed for post-login redirect to whatever the user last visited. - return unless request.get? - - if (!NO_REDIRECT.include?(request.path) && !request.xhr?) - session[:previous_url] = request.fullpath - end - end - def set_host_for_local_storage Rails.application.routes.default_url_options[:host] = request.base_url if Rails.application.config.active_storage.service == :local # TODO Check why this is not set automatically