Skip to content

Commit

Permalink
remove redundant method and global variable from controller
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleypliu committed Sep 23, 2020
1 parent 6348edf commit fe571d1
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/?}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fe571d1

Please sign in to comment.