pipedrive_jetrockets 0.0.48 → 0.0.49

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: db0a5f14b02b1a23edba03f60286d9d8cc274b9b926610a330b935394b764b77
4
- data.tar.gz: cc9ceb9b4f40394a9ad7eec41d3dea5b5afc6fddf2a75c91465751b6bc3f8ba1
3
+ metadata.gz: 20704d30a12ff66fb6bdaf215ddf5d786f7baaa4e5a2c170a6291afbdfc0b5c5
4
+ data.tar.gz: ed8f15f5e55a3836744c013a6cc4df3d14b2ac86d2bcb4310208dc1bba6dc5c1
5
5
  SHA512:
6
- metadata.gz: 0cadde31c9e284a266bb498f609be8762e3197ad1d6123ee295b3bf708f7e19102e48a6563c2d7a571c063fab12494e701330966986e9bbcf70ff2a82416b0b6
7
- data.tar.gz: db085bdaba31648bd3a50abc1a79a1a39a6f16ea211ce38389621f528c4b510f02f53e405a1c3954614204609300c1efeb0c77e024433c2afbb26d295dc64497
6
+ metadata.gz: 84e7fcdc4ebb45571551f958257275e1398a9b477ecaeb10f2d857f6a507afa26aa3b808d85d01452421fb48a203ae9963f79d8e7d40c2660c8effd6083006d6
7
+ data.tar.gz: 755d2ae4f32e649b4548d2ecf000abe20779722df455c42873112e4838844813d5ea16bb157ae658113d8ca22786cae2646ad158f0c568966b46ac8f236c0cfe
@@ -7,8 +7,24 @@ module PipedriveJetrockets
7
7
  attr_accessor :add_time, :id, :organisation, :title, :value, :currency, :status, :stage_id, :person
8
8
  def initialize(hash)
9
9
  super
10
- @organisation = Organisation.new(hash['org_id']) if hash['org_id']
11
- @person = Person.new(hash['person_id']) if hash['person_id']
10
+ org_id = hash['org_id']
11
+ person_id = hash['person_id']
12
+
13
+ if org_id
14
+ if org_id.kind_of? Integer
15
+ @organisation = Pipedrive.organisations.find(org_id)
16
+ else
17
+ @organisation = Organisation.new(org_id)
18
+ end
19
+ end
20
+
21
+ if person_id
22
+ if person_id.kind_of? Integer
23
+ @person = Pipedrive.persons.find(person_id)
24
+ else
25
+ @person = Person.new(person_id)
26
+ end
27
+ end
12
28
  end
13
29
 
14
30
  def stage
@@ -9,7 +9,11 @@ class Pipedrive
9
9
  end
10
10
 
11
11
  def self.notes
12
- @@persons_service ||= PipedriveJetrockets::Service.new('note')
12
+ @@notes_service ||= PipedriveJetrockets::Service.new('note')
13
+ end
14
+
15
+ def self.organisations
16
+ @@organisations_service ||= PipedriveJetrockets::Service.new('organisation')
13
17
  end
14
18
 
15
19
  def self.persons
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipedrive_jetrockets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.48
4
+ version: 0.0.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agafonov Maksim