Class: DemoMode::Session
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- DemoMode::Session
- Defined in:
- app/models/demo_mode/session.rb
Instance Method Summary collapse
-
#persona ⇒ Object
Heads up: finding a persona is not guaranteed (e.g. past sessions).
- #save_and_generate_account! ⇒ Object
- #save_and_generate_account_later! ⇒ Object
- #signinable_username ⇒ Object
Instance Method Details
#persona ⇒ Object
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 save_and_generate_account_later! transaction do save! AccountGenerationJob.perform_later(self) end end |
#signinable_username ⇒ Object
19 20 21 |
# File 'app/models/demo_mode/session.rb', line 19 def signinable_username signinable.public_send(DemoMode.signinable_username_method) end |