Class: Amorail::ContactLink
- Defined in:
- lib/amorail/entities/contact_link.rb
Overview
AmoCRM contact-link join model
Class Method Summary collapse
-
.find_by_contacts(*ids) ⇒ Object
Find links by contacts ids.
-
.find_by_leads(*ids) ⇒ Object
Find links by leads ids.
Methods inherited from Entity
amo_field, amo_names, amo_property, attributes, find, find!, find_all, find_by_query, inherited, #initialize, #load_record, #new_record?, #params, #persisted?, properties, #reload, #reload_model, remote_url, #save, #save!, #update, #update!, where
Constructor Details
This class inherits a constructor from Amorail::Entity
Class Method Details
.find_by_contacts(*ids) ⇒ Object
Find links by contacts ids
12 13 14 15 16 17 18 19 20 |
# File 'lib/amorail/entities/contact_link.rb', line 12 def find_by_contacts(*ids) ids = ids.first if ids.size == 1 && ids.first.is_a?(Array) response = client.safe_request( :get, remote_url('links'), contacts_link: ids ) load_many(response) end |
.find_by_leads(*ids) ⇒ Object
Find links by leads ids
23 24 25 26 27 28 29 30 31 |
# File 'lib/amorail/entities/contact_link.rb', line 23 def find_by_leads(*ids) ids = ids.first if ids.size == 1 && ids.first.is_a?(Array) response = client.safe_request( :get, remote_url('links'), deals_link: ids ) load_many(response) end |