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

Version Path
pg_rails-7.6.20 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.19 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.18 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.17 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.16 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.15 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.14 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.13 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.12 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.11 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.10 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.9 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.8 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.7 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.6 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.5 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.4 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.3 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.2 pg_engine/app/controllers/users/account_switcher_controller.rb
pg_rails-7.6.1 pg_engine/app/controllers/users/account_switcher_controller.rb