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 +4 -4
- data/lib/pipe_drive/deal.rb +2 -2
- data/lib/pipe_drive/resource_base.rb +9 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3c8da759f5682981b299f1b2867cf088a0f357c40e290a9ff3641feed6ecc79
|
4
|
+
data.tar.gz: 574c46c1c84e0580dc4d66b4210b95650dedd2fe5e08e03e289601fa8b394fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e63336f8f2ec719f7ec4571730dae526330dfdc73b28cb5120bdafeb7f520027f2b81738e266ea0da3f17aad8915e5442a4c58e10ff52a51a6382b6788202944
|
7
|
+
data.tar.gz: 6005fc5263232a441670554956c05b64b3e0fca88301df41e11d407994b8de48574844e1f7cca266ec0f825e1ca3b1e601e51ae0db497c5086b90e477089192c
|
data/lib/pipe_drive/deal.rb
CHANGED
@@ -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(
|
7
|
+
Organization.find_by_id(organization)
|
8
8
|
end
|
9
9
|
|
10
10
|
def person
|
11
|
-
Person.find_by_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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|