Class: MembershipKit
- Inherits:
-
Kit
- Object
- ActiveRecord::Base
- Kit
- MembershipKit
show all
- Includes:
- ActionView::Helpers::SanitizeHelper
- Defined in:
- app/models/kits/membership_kit.rb
Constant Summary
collapse
- ACCESSORS =
[ :marketing_copy_heading, :marketing_copy_sidebar, :limit_per_transaction ]
Instance Method Summary
collapse
Methods inherited from Kit
#abilities, #activatable?, activate, activation_requirements, acts_as_kit, #admin_approvable?, admin_approval_requirements, admin_approve, #alternatives, #approvable?, approval_requirements, approve, #has_alternatives?, mailchimp, pad_with_new_kits, #requirements_met?, subklasses, visible, when_active
#record_activation, #record_approval
Instance Method Details
46
47
48
49
|
# File 'app/models/kits/membership_kit.rb', line 46
def configured!
settings[:membership_state] = "configured"
save
end
|
42
43
44
|
# File 'app/models/kits/membership_kit.rb', line 42
def configured?
membership_state == "configured"
end
|
#friendly_name ⇒ Object
29
30
31
|
# File 'app/models/kits/membership_kit.rb', line 29
def friendly_name
"Membership"
end
|
#initialize_accessors ⇒ Object
51
52
53
54
55
|
# File 'app/models/kits/membership_kit.rb', line 51
def initialize_accessors
ACCESSORS.each do |accessor|
self.send("#{accessor}=", "") if self.send("#{accessor}").nil?
end
end
|
#no_bank_account? ⇒ Boolean
33
34
35
36
|
# File 'app/models/kits/membership_kit.rb', line 33
def no_bank_account?
errors.add(:requirements, "Your organization needs bank account information first.") if organization.bank_account.nil?
organization.bank_account.nil?
end
|
#pitch ⇒ Object
38
39
40
|
# File 'app/models/kits/membership_kit.rb', line 38
def pitch
"Sell Memberships!"
end
|
#sanitize_accessors ⇒ Object
57
58
59
60
61
|
# File 'app/models/kits/membership_kit.rb', line 57
def sanitize_accessors
ACCESSORS.each do |accessor|
self.send("#{accessor}=", (sanitize self.send(accessor)))
end
end
|