pipe_drive_ruby_wrapper 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3c8da759f5682981b299f1b2867cf088a0f357c40e290a9ff3641feed6ecc79
4
- data.tar.gz: 574c46c1c84e0580dc4d66b4210b95650dedd2fe5e08e03e289601fa8b394fb2
3
+ metadata.gz: d3f1272be9378449508f94f4163c42fffd5607f5aba7de4ea509d8dd276798c8
4
+ data.tar.gz: c5aa10c325bfce383987ebada3921f97e1822ea2b351c47501eaa82507e97f9d
5
5
  SHA512:
6
- metadata.gz: e63336f8f2ec719f7ec4571730dae526330dfdc73b28cb5120bdafeb7f520027f2b81738e266ea0da3f17aad8915e5442a4c58e10ff52a51a6382b6788202944
7
- data.tar.gz: 6005fc5263232a441670554956c05b64b3e0fca88301df41e11d407994b8de48574844e1f7cca266ec0f825e1ca3b1e601e51ae0db497c5086b90e477089192c
6
+ metadata.gz: abaabdd5a1e1a2442411640e86a4f7e4eaa69a54177f425244071c558f13f69512a097603f1f621edbd33e71d804c7fd42d75f666c11d530707a0a2e41c1690f
7
+ data.tar.gz: 5c50e3d45d7b8fa452666bd01b825c53a229ff4a19f9566ecea9ff51c1b0f9c2fc96e5bc1eff49d713b90fc0a7a9b031722b2a6f92bba400bcbcca0a33e5722c
@@ -4,11 +4,13 @@ module PipeDrive
4
4
  ALLOW_FOR_ADDITION_SEARCH_OPTS = %i[org_id person_id]
5
5
 
6
6
  def organization
7
- Organization.find_by_id(organization)
7
+ pipedrive_org_id = org_id.is_a?(Hash) ? org_id[:value] : org_id
8
+ Organization.find_by_id(pipedrive_org_id)
8
9
  end
9
10
 
10
11
  def person
11
- Person.find_by_id(contact_person)
12
+ pipedrive_person_id = person_id.is_a?(Hash) ? person_id[:value] : person_id
13
+ Person.find_by_id(pipedrive_person_id)
12
14
  end
13
15
  end
14
16
  end
@@ -6,8 +6,13 @@ module PipeDrive
6
6
  data = attrs[:data] || PipeDrive.hash_except(attrs, [:additional_data])
7
7
  processed_data = {}
8
8
  data.each_pair do |key, value|
9
- field_name_map = self.class.field_names[key.to_s]
10
- field_name = field_name_map.nil? ? key : field_name_map[:name]
9
+ key = key.to_s
10
+ if key.end_with?('_id')
11
+ field_name = key
12
+ else
13
+ field_name_map = self.class.field_names[key]
14
+ field_name = field_name_map.nil? ? key : field_name_map[:name]
15
+ end
11
16
  processed_data[field_name] = value
12
17
  end
13
18
  attrs[:data] = processed_data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipe_drive_ruby_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiaRou Lee