Class: Seedy::Leads

Inherits:
Record show all
Defined in:
lib/seedy/records/leads.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Record

#initialize, #inspect, #to_s, #to_sql

Constructor Details

This class inherits a constructor from Seedy::Record

Class Method Details

.build(user, team, contact, opp, account) ⇒ Object



31
32
33
34
35
# File 'lib/seedy/records/leads.rb', line 31

def build(user, team, contact, opp, )
  lead = Leads.new
  lead.associate(user,team,contact,opp,)
  lead
end

Instance Method Details

#associate(user, team, contact, opp, account) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/seedy/records/leads.rb', line 38

def associate(user, team, contact, opp, )
  write_attribute(:modified_user_id, user.id)
  write_attribute(:assigned_user_id, user.id)
  write_attribute(:team_id, team)
  write_attribute(:created_by, user.id)
  write_attribute(:contact_id, contact)
  write_attribute(:account_id, )
  write_attribute(:opportunity_id, opp)
end