Sha256: 878aa60c93b0c0d53851cbdce74f9836439db3aa7bb6a54822b2cd52d7f66653
Contents?: true
Size: 758 Bytes
Versions: 23
Compression:
Stored size: 758 Bytes
Contents
module Users class AccountSwitcherController < PgEngine.config.users_controller rescue_from ActsAsTenant::Errors::NoTenantSet, with: :internal_error skip_before_action :require_tenant_set before_action do @no_main_frame = true end layout 'pg_layout/centered' around_action :set_without_tenant def set_without_tenant(&) ActsAsTenant.without_tenant(&) end def list @user_accounts = Current.user.user_accounts.kept end def switch # FIXME: handle not found scope = Current.user.user_accounts.kept user_account = scope.find(UserAccount.decode_id(params[:user_account_id])) session['current_user_account'] = user_account.id redirect_to root_path end end end
Version data entries
23 entries across 23 versions & 1 rubygems