Class: DemoMode::Session

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/demo_mode/session.rb

Instance Method Summary collapse

Instance Method Details

#personaObject

Heads up: finding a persona is not guaranteed (e.g. past sessions)



24
25
26
# File 'app/models/demo_mode/session.rb', line 24

def persona
  DemoMode.personas.find { |p| p.name.to_s == persona_name.to_s }
end

#save_and_generate_account!Object



28
29
30
31
32
33
# File 'app/models/demo_mode/session.rb', line 28

def save_and_generate_account!
  transaction do
    save!
    AccountGenerationJob.perform_now(self)
  end
end

#save_and_generate_account_later!Object



35
36
37
38
39
40
# File 'app/models/demo_mode/session.rb', line 35

def 
  transaction do
    save!
    AccountGenerationJob.perform_later(self)
  end
end

#signinable_usernameObject



19
20
21
# File 'app/models/demo_mode/session.rb', line 19

def signinable_username
  signinable.public_send(DemoMode.signinable_username_method)
end