Rebuild rubocop TODOs after auto-correcting
This commit is contained in:
parent
31c50255e9
commit
84dbb52d11
580 changed files with 3689 additions and 3133 deletions
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
before_action :set_paper_trail_whodunnit
|
||||
include ApplicationHelper
|
||||
|
|
@ -11,24 +13,24 @@ class ApplicationController < ActionController::Base
|
|||
def store_location
|
||||
# store last url - this is needed for post-login redirect to whatever the user last visited.
|
||||
return unless request.get?
|
||||
if (request.path != '/accounts/sign_in' &&
|
||||
request.path != '/accounts/sign_up' &&
|
||||
request.path != '/accounts/password/new' &&
|
||||
request.path != '/accounts/password/edit' &&
|
||||
request.path != '/accounts/confirmation' &&
|
||||
request.path != '/accounts/sign_out' &&
|
||||
request.path != '/users/ichain_registration/ichain_sign_up' &&
|
||||
!request.path.starts_with?(Devise.ichain_base_url) &&
|
||||
!request.xhr?) # don't store ajax calls
|
||||
if request.path != '/accounts/sign_in' &&
|
||||
request.path != '/accounts/sign_up' &&
|
||||
request.path != '/accounts/password/new' &&
|
||||
request.path != '/accounts/password/edit' &&
|
||||
request.path != '/accounts/confirmation' &&
|
||||
request.path != '/accounts/sign_out' &&
|
||||
request.path != '/users/ichain_registration/ichain_sign_up' &&
|
||||
!request.path.starts_with?(Devise.ichain_base_url) &&
|
||||
!request.xhr? # don't store ajax calls
|
||||
session[:return_to] = request.fullpath
|
||||
end
|
||||
end
|
||||
|
||||
def after_sign_in_path_for(_resource)
|
||||
if (can? :view, Conference) &&
|
||||
(!session[:return_to] ||
|
||||
session[:return_to] &&
|
||||
session[:return_to] == root_path)
|
||||
(!session[:return_to] ||
|
||||
session[:return_to] &&
|
||||
session[:return_to] == root_path)
|
||||
admin_conferences_path
|
||||
else
|
||||
session[:return_to] || root_path
|
||||
|
|
@ -61,10 +63,10 @@ class ApplicationController < ActionController::Base
|
|||
Rails.logger.debug('User is disabled!')
|
||||
sign_out(current_user)
|
||||
mail = User.admin.first ? User.admin.first.email : 'the admin!'
|
||||
redirect_to User.ichain_logout_url, error: "This User is disabled. Please contact #{mail}!"
|
||||
redirect_to User.ichain_logout_url, error: "This User is disabled. Please contact #{mail}!"
|
||||
end
|
||||
|
||||
def not_found
|
||||
raise ActionController::RoutingError.new('Not Found')
|
||||
raise ActionController::RoutingError, 'Not Found'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue