contacts_client 0.0.38 → 0.0.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/contacts/belongs_to_contact.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTgxYjk4ODM5MDhlNDc3ODRhNDYyZmYwYTU4NGY4OWQ1ZWEyZTBhZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGI5MjA1Mjg1NzlkNTBlZmEwMzYzNzA3Y2JmNjNhOTJlOTAyYzUyMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGE2NjU0Y2ZiMzlkNjk0MDNhODhiNWQzZTdkNjlkZmRmMDg3ZTcwZWMzZTU1
|
10
|
+
ZjJlMDRiNGY3ZDg4NGYzMzc2Y2JlMGQ3NTNiZDg4NjdjM2NiY2NhYTYwZWY1
|
11
|
+
NDAxM2EzZWYwMzE5NzEzOTg1YzhjNjcxN2I4MTFlNGVhYWVjYzE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzE2ZmU5YjU5ODhmNjYyYzg1NDhmODEyYjc2NzA5ZDY1NWVkN2E0MDg3YmE1
|
14
|
+
YjFiNWNiODhlNmRiM2MyMzhjYTBhMTZlM2QyZGViOWIyYTkzOGI4ODc4ZTg1
|
15
|
+
NmVkOTNkYmUwOWRhNjMzNzRjZGQ0ZmI4M2Y3MWZiZjlkYWY2NGY=
|
@@ -4,6 +4,7 @@ module BelongsToContact
|
|
4
4
|
|
5
5
|
def self.included(base)
|
6
6
|
base.send(:validate, :padma_contact_setted_correctly)
|
7
|
+
base.extend ClassMethods
|
7
8
|
end
|
8
9
|
|
9
10
|
attr_accessor :padma_contact
|
@@ -27,6 +28,17 @@ module BelongsToContact
|
|
27
28
|
ret
|
28
29
|
end
|
29
30
|
|
31
|
+
module ClassMethods
|
32
|
+
def prefetch_contacts_for_collection(collection,ws_options={})
|
33
|
+
contact_ids = collection.map(&:contact_id).uniq
|
34
|
+
ws_options = ws_options.merge({ids: contact_ids, per_page: contact_ids.size})
|
35
|
+
contacts = PadmaContact.search(ws_options)
|
36
|
+
if contacts
|
37
|
+
collection.each{|i| i.padma_contact= contacts.select{|c|c.id==i.contact_id}.first }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
30
42
|
private
|
31
43
|
|
32
44
|
# If padma_contact is setted with a PadmaContact that doesn't match
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contacts_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dwayne Macgowan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|