Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed the way account contacts are merged.

  • Loading branch information...
commit 54c9f81932d06cd2708eeb6c058818f82bedc289 1 parent 24d47ab
@steveyken steveyken authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/ffcrm_merge/accounts.rb
View
4 lib/ffcrm_merge/accounts.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.