Skip to content

Commit

Permalink
Changed the way account contacts are merged.
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyken committed Mar 1, 2013
1 parent 24d47ab commit 54c9f81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ffcrm_merge/accounts.rb
Expand Up @@ -43,7 +43,9 @@ def merge_with(master, ignored_attr = [])
self.contacts.each do |contact|
# Check if contact belongs to master already? Can happen in CRM's where contacts can belong to multiple accounts
if AccountContact.where(:contact_id => contact.id).where(:account_id => master.id).size == 0
AccountContact.create(:contact_id => contact.id, :account_id => master.id)
ac = AccountContact.where(:contact_id => contact.id).where(:account_id => self.id).first
ac.account_id = master.id
ac.save!
end
end

Expand Down

0 comments on commit 54c9f81

Please sign in to comment.