Class: Offer
- Inherits:
-
Renderable
show all
- Includes:
- E9Rails::ActiveRecord::InheritableOptions, E9Rails::ActiveRecord::Initialization, E9Rails::ActiveRecord::STI
- Defined in:
- app/models/offer.rb
Overview
A Renderable
which “offers” the user something. Responses to these offers are tracked as Leads
Defined Under Namespace
Modules: Identifiers
Classes: Drop
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.conversion_email ⇒ Object
.element ⇒ Object
48
49
50
|
# File 'app/models/offer.rb', line 48
def element
'offer'
end
|
.page ⇒ Object
40
41
42
|
# File 'app/models/offer.rb', line 40
def page
SystemPage.find_by_identifier(Identifiers::PAGE)
end
|
.partial_path ⇒ Object
44
45
46
|
# File 'app/models/offer.rb', line 44
def partial_path
'e9_crm/offers/offer'
end
|
Instance Method Details
#has_mailing_list?(ml) ⇒ Boolean
25
26
27
|
# File 'app/models/offer.rb', line 25
def has_mailing_list?(ml)
(mailing_list_ids || []).map(&:to_s).member?(ml.id.to_s)
end
|
#mailing_lists ⇒ Object
29
30
31
32
33
|
# File 'app/models/offer.rb', line 29
def mailing_lists
@_mailing_lists ||= begin
mailing_list_ids ? MailingList.find_all_by_id(mailing_list_ids) : []
end
end
|
#to_liquid ⇒ Object
57
58
59
|
# File 'app/models/offer.rb', line 57
def to_liquid
Drop.new(self)
end
|
#to_s ⇒ Object
53
54
55
|
# File 'app/models/offer.rb', line 53
def to_s
name
end
|