Module: Card::Set::Type::Signup
- Extended by:
- Card::Set
- Defined in:
- platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb,
platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb
Overview
Defined Under Namespace
Modules: Views
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 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
#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
#include_set, #include_set_formats
#card_accessor, #card_reader, #card_writer, #require_field
Methods included from Event::Api
#event
Class Method Details
.source_location ⇒ Object
7
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 7
def self.source_location; "/Users/ethan/dev/decko/gem/mod/account/set/type/signup.rb"; end
|
Instance Method Details
#activate_accounted ⇒ Object
22
23
24
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 22
def activate_accounted
self.type_id = Card.default_accounted_type_id
end
|
#approvable ⇒ Object
53
54
55
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 53
def approvable
can_approve? ? yield : abort(:failure, "illegal approval") end
|
#can_approve? ⇒ Boolean
18
19
20
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 18
def can_approve?
Card.new(type_id: Card.default_accounted_type_id).ok? :create
end
|
#default_account_status ⇒ Object
14
15
16
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 14
def default_account_status
can_approve? ? "unverified" : "unapproved"
end
|
#event: act_as_current_for_integrate_stage ⇒ Object
42
43
44
45
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 42
event :act_as_current_for_integrate_stage, :integrate, on: :create do
Auth.current_id = id
end
|
#event: approve_with_verification ⇒ Object
30
31
32
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 30
event :approve_with_verification, :validate, on: :update, trigger: :required do
approvable { request_verification }
end
|
#event: approve_without_verification ⇒ Object
34
35
36
37
38
39
40
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 34
event :approve_without_verification, :validate, on: :update, trigger: :required do
approvable do
activate_accounted
field(:account).activate_account
end
end
|
#event: auto_approve_with_verification ⇒ Object
26
27
28
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 26
event :auto_approve_with_verification, :validate, on: :create, when: :can_approve? do
request_verification
end
|
#request_verification ⇒ Object
47
48
49
50
51
|
# File 'platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb', line 47
def request_verification
acct = field :account
acct.field :status, content: "unverified"
acct.trigger_event! :send_verification_email
end
|