Sha256: 47876626e5395be3d8ab5bbe34407c5cd770c1f41020fea52fe3f73f29965631
Contents?: true
Size: 1.5 KB
Versions: 1
Compression:
Stored size: 1.5 KB
Contents
# A +Renderable+ which "offers" the user something. Responses to these # offers are tracked as +Leads+ # class Offer < Renderable include E9Rails::ActiveRecord::STI include E9Rails::ActiveRecord::Initialization include E9Rails::ActiveRecord::InheritableOptions has_many :deals, :inverse_of => :offer has_many :leads, :class_name => 'Deal', :conditions => ["deals.status = ?", Deal::Status::Lead] validates :conversion_alert_email, :email => { :allow_blank => true } mount_uploader :file, FileUploader self.delegate_options_methods = true self.options_parameters = [ :submit_button_text, :success_alert_text, :success_page_text, :download_link_text, :conversion_alert_email, :custom_form_html ] class << self def conversion_email SystemEmail.find_by_identifier(Identifiers::CONVERSION_EMAIL) end def page SystemPage.find_by_identifier(Identifiers::PAGE) end def partial_path 'e9_crm/offers/offer' end def element 'offer' end end def to_s name end def to_liquid Drop.new(self) end protected def _assign_initialization_defaults self.submit_button_text ||= 'Submit!' self.download_link_text ||= 'Click to download your file' self.success_page_text ||= 'Thank you!' end class Drop < ::E9::Liquid::Drops::Base source_methods :name, :deals, :leads end module Identifiers CONVERSION_EMAIL = 'offer_conversion_email' PAGE = 'offer_page' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
e9_crm-0.1.18 | app/models/offer.rb |