Class: Deal

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
E9Rails::ActiveRecord::InheritableOptions, E9Rails::ActiveRecord::Initialization, E9Rails::ActiveRecord::Scopes::Times
Defined in:
app/models/deal.rb

Overview

Generated from a Lead, owned by a Campaign. Deals represent potential “deals” with contacts and track revenue used for marketing reports.

Defined Under Namespace

Modules: Status

Instance Attribute Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object (protected)



186
187
188
189
190
191
192
# File 'app/models/deal.rb', line 186

def method_missing(method_name, *args)
  if method_name =~ /(.*)\?$/ && Status::OPTIONS.member?($1)
    self.status == $1
  else
    super
  end
end

Instance Attribute Details

#mailing_list_idsObject

mailing_list_ids may be set on Deals when they are being created as leads, this is done via opt-in checkboxes on the form



60
61
62
# File 'app/models/deal.rb', line 60

def mailing_list_ids
  @mailing_list_ids
end