api_client_bulk_loader 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8950f561f2f644e3f046a7611323e5dd351861eb
|
|
4
|
+
data.tar.gz: f975f44ce0988bca9f72b05d120ce2be9df3dd06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 080a5446825db4671d0934ec7d8d140e28234a002bb2f27055a1d129b1ba8ebc38a7ceb67b217867c9bafd3ec5cb3c8482bc327779b6d68c4959f11a6834593b
|
|
7
|
+
data.tar.gz: e9c761044f32e5e6d13dc7941ed8dc29b24cb05fc6fd5265574fd767aae1ecafc72c89a0d744efe1aae666349079986c5b6889e2b9685dded1fe5cb047fd247e
|
|
@@ -52,7 +52,8 @@ module ApiClientBulkLoader
|
|
|
52
52
|
|
|
53
53
|
results = if attribute != :id #Index the returned results by the attribute used to query by, this is used when bulk querying by some foreign key.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
#per_page is slighly opinionated towards JsonApiClient, but should be ignored by everything else.
|
|
56
|
+
Array(model.find(attribute => values, :per_page => values.size)).group_by{|obj| obj.send(attribute) }
|
|
56
57
|
|
|
57
58
|
else #Index the results by their ids.
|
|
58
59
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: api_client_bulk_loader
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- alex
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-04-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|