diff options
Diffstat (limited to 'app/models/contact.rb')
-rw-r--r-- | app/models/contact.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/contact.rb b/app/models/contact.rb index 1d7755784..861ec0771 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -89,6 +89,17 @@ class Contact < ActiveRecord::Base end end + def self.contact_contacts_for(user, person) + return none unless user + + if person == user.person + user.contact_people + else + contact = user.contact_for(person) + contact.try(:contacts) || none + end + end + private def not_contact_with_closed_account if person_id && person.closed_account? |