Reduce complexity of ApplicationController.store_location

This commit is contained in:
Brenda Wallace
2017-02-01 22:59:40 +13:00
parent 3ecc7ba99b
commit 8a69ed4013

View File

@@ -7,13 +7,12 @@ class ApplicationController < ActionController::Base
before_action :set_locale
def store_location
if (request.path != "/members/sign_in" &&
request.path != "/members/sign_up" &&
request.path != "/members/password/new" &&
request.path != "/members/password/edit" &&
request.path != "/members/confirmation" &&
request.path != "/members/sign_out" &&
!request.xhr?)
unless (request.path.in?(["/members/sign_in",
"/members/sign_up",
"/members/password/new",
"/members/password/edit",
"/members/confirmation",
"/members/sign_out"]) || request.xhr?)
store_location_for(:member, request.fullpath)
end
end