Class: SetupTent

Inherits:
Object
  • Object
show all
Defined in:
lib/tentd-admin/setup_tent.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ SetupTent

Returns a new instance of SetupTent.



2
3
4
# File 'lib/tentd-admin/setup_tent.rb', line 2

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/tentd-admin/setup_tent.rb', line 6

def call(env)
  TentD::Model::User.current = user = TentD::Model::User.first_or_create
  env['rack.session']['current_user_id'] = user.id
  set_client(env)
  create_core_profile(env)
  @app.call(env)
end