pipe_drive_ruby_wrapper 0.2.3 → 0.2.4

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: af042bbd75c486a6402e783b422e6a7bc8f6144c2efb7bd2c050c149e59290e0
4
- data.tar.gz: f0eca92a11ca625dc15005ab56fb2f22b8c0020bfff88cee99c7abcfc0ef8262
3
+ metadata.gz: a3c8da759f5682981b299f1b2867cf088a0f357c40e290a9ff3641feed6ecc79
4
+ data.tar.gz: 574c46c1c84e0580dc4d66b4210b95650dedd2fe5e08e03e289601fa8b394fb2
5
5
  SHA512:
6
- metadata.gz: 81c4ef35bd3ade27bb52d0bf58bad303f5104628ed2bd261a1d39cf50045e904dcf643f42441b4dd560203d08954f7d9b155a4f18b36a5601ee1b4d52439d49d
7
- data.tar.gz: dd2de0dbf8c30ae95d58ab6897fb22884029f5eea173f73246438e14ab5a91382f35027fdb5c4026ad4743144f36093440680ab2d2dae401a0d108d445d47af4
6
+ metadata.gz: e63336f8f2ec719f7ec4571730dae526330dfdc73b28cb5120bdafeb7f520027f2b81738e266ea0da3f17aad8915e5442a4c58e10ff52a51a6382b6788202944
7
+ data.tar.gz: 6005fc5263232a441670554956c05b64b3e0fca88301df41e11d407994b8de48574844e1f7cca266ec0f825e1ca3b1e601e51ae0db497c5086b90e477089192c
@@ -4,11 +4,11 @@ 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(org_id)
7
+ Organization.find_by_id(organization)
8
8
  end
9
9
 
10
10
  def person
11
- Person.find_by_id(person_id)
11
+ Person.find_by_id(contact_person)
12
12
  end
13
13
  end
14
14
  end
@@ -2,14 +2,16 @@ module PipeDrive
2
2
  class ResourceBase < Base
3
3
 
4
4
  def initialize(attrs)
5
- data = attrs[:data] || PipeDrive.hash_except(attrs, [:additional_data])
6
- processed_data = {}
7
- data.each_pair do |key, value|
8
- field_name_map = self.class.field_names[key.to_s]
9
- field_name = field_name_map.nil? ? key : field_name_map[:name]
10
- processed_data[field_name] = value
5
+ unless self.class.field_names.nil?
6
+ data = attrs[:data] || PipeDrive.hash_except(attrs, [:additional_data])
7
+ processed_data = {}
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]
11
+ processed_data[field_name] = value
12
+ end
13
+ attrs[:data] = processed_data
11
14
  end
12
- attrs[:data] = processed_data
13
15
 
14
16
  super(attrs)
15
17
  end
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.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiaRou Lee