nazrin 2.6.2 → 2.6.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e9cf38a42182748cb66ae4cbe9b0fdee0ee0e28
|
4
|
+
data.tar.gz: 1697512262d0dc064e714f916475ca2a98bdfa28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aadbe716cbbb97d6a22147a1b0341df7a7ce06b8eef371d3e1e00f2570c1fe1a1d8a2bcb4b809a5a199c98a1d8596ac11241b1c1beb1613901a948d2a4d8c840
|
7
|
+
data.tar.gz: 469c6dec4d4fa66a1972a9c4cb5b1d860ad9fd939024ad7e9cb6842652f084e77084cfce4bd4599ece4e4f56f9a526058fb819e9e45ca1b8beab7f8d598f47f5
|
@@ -4,15 +4,16 @@ module Nazrin
|
|
4
4
|
# load from activerecord
|
5
5
|
def load_all(ids)
|
6
6
|
records_table = {}
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
relation = options.reduce(model) do |rel, (k, v)|
|
9
|
+
rel.send(k, v)
|
9
10
|
end
|
10
|
-
|
11
|
-
|
11
|
+
|
12
|
+
relation.where(id: ids).each do |record|
|
13
|
+
records_table[record.id.to_s] = record
|
12
14
|
end
|
13
|
-
|
14
|
-
|
15
|
-
end.reject(&:nil?)
|
15
|
+
|
16
|
+
records_table.values_at(*ids.map(&:to_s)).compact
|
16
17
|
end
|
17
18
|
|
18
19
|
def data_from_response(res)
|
@@ -3,19 +3,16 @@ module Nazrin
|
|
3
3
|
class Mongoid < Nazrin::DataAccessor
|
4
4
|
def load_all(ids)
|
5
5
|
documents_table = {}
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
else
|
10
|
-
model.send(k, v)
|
11
|
-
end
|
6
|
+
|
7
|
+
relation = options.reduce(model) do |rel, send_args|
|
8
|
+
rel.send(*send_args.compact)
|
12
9
|
end
|
13
|
-
|
10
|
+
|
11
|
+
relation.where('_id' => { '$in' => ids }).each do |document|
|
14
12
|
documents_table[document._id.to_s] = document
|
15
13
|
end
|
16
|
-
|
17
|
-
|
18
|
-
end.reject(&:nil?)
|
14
|
+
|
15
|
+
documents_table.values_at(*ids.map(&:to_s)).compact
|
19
16
|
end
|
20
17
|
|
21
18
|
def data_from_response(res)
|
data/lib/nazrin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nazrin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomohiro Suwa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|