Module: Card::Set::Right::Account::Events

Extended by:
Card::Set
Defined in:
platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb

Overview

Set: All “+Account+Events” cards (Events)

ON CREATE

Constant Summary

Constants included from Helpers

Helpers::SET_PATTERN_TEST_REGEXP

Constants included from Event::Api

Event::Api::OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Card::Set

reset

Methods included from I18nScope

#mod_name, #scope

Methods included from Card::Set::Registrar

#extended, #finalize_load, #process_base_modules, #register_set

Methods included from Helpers

#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name

Methods included from AdvancedApi

#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #stage_method

Methods included from Format

#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Class Method Details

.source_locationObject



8
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 8

def self.source_location; "/Users/ethan/dev/decko/gem/mod/account/set/right/account/events.rb"; end

Instance Method Details

#event: activate_accountObject

NOTE: this only works in the context of an action. if run independently, it will not activate an account



47
48
49
50
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 47

event :activate_account do
  field :status, content: "active"
  trigger_event! :send_welcome_email
end

#event: delete_accountObject



52
53
54
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 52

event :delete_account, :prepare_to_validate, on: :delete do
  subcard accounted.
end

#event: password_redirectObject



33
34
35
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 33

event :password_redirect, :finalize, on: :update, when: :password_redirect? do
  success << { id: name, view: "edit" }
end

#event: reset_passwordObject

reset password emails contain a link to update the +*account card and trigger this event



22
23
24
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 22

event :reset_password, :prepare_to_validate, on: :update, trigger: :required do
  verifying_token :reset_password_success, :reset_password_failure
end

#event: set_default_saltObject



10
11
12
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 10

event :set_default_salt, :prepare_to_validate, on: :create do
  field(:salt).generate
end

#event: set_default_statusObject



14
15
16
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 14

event :set_default_status, :prepare_to_validate, on: :create do
  field :status, content: accounted&.try(:default_account_status) || "active"
end

#event: signout_upon_deleteObject



56
57
58
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 56

event :signout_upon_delete, :integrate, on: :delete, when: :current_account? do
  Self::Signin.signout
end

#event: verify_and_activateObject



26
27
28
29
30
31
# File 'platypus/tmp/set/gem-defaults/mod014-account/right/account/events.rb', line 26

event :verify_and_activate, :prepare_to_validate, on: :update, trigger: :required do
  activatable do
    verifying_token :verify_and_activate_success, :verify_and_activate_failure
    subcard(accounted)&.try :activate_accounted
  end
end