Class: Seedy::Contacts

Inherits:
Record
  • Object
show all
Defined in:
lib/seedy/records/contacts.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, account) ⇒ Object



27
28
29
30
31
# File 'lib/seedy/records/contacts.rb', line 27

def build(user, team, )
  contact = Contacts.new
  contact.associate(user,team,)
  contact
end

Instance Method Details

#associate(user, team, account) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/seedy/records/contacts.rb', line 34

def associate(user, team, )
  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)
  join("accounts_contacts", {
    :id => Random.guid, 
    :account_id => , 
    :contact_id => read_attribute(:id), 
    :date_modified => read_attribute(:date_modified)})
end