co-elastic-query 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/co-elastic-query.rb +3 -2
- data/lib/co-elastic-query/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bd337a7275ec8cec28308fad9de92bf3a0c6564
|
4
|
+
data.tar.gz: 457927186441945763961a96ec56ecaf563e3be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 848c7bcfce64a91f66a998461773148d74a7e3850de9ab553546aced805bdca7805b105f65a1138d65206cd2c645b8cb5ef9811c0cd09fb66fe25a1c907528f5
|
7
|
+
data.tar.gz: d7aa50ade0d46c16978b56611f53b1d6eb57df3ce34f46b97b96a08fb8200a0d1d80d6cde2e88fe2dffcc3c140efb88220ae8dbbb42ae98f23b2d82920793976
|
data/lib/co-elastic-query.rb
CHANGED
@@ -236,12 +236,13 @@ class Elastic
|
|
236
236
|
# if a formatter block is supplied, each loaded record is passed to it
|
237
237
|
# allowing annotation/conversion of records using data from the model
|
238
238
|
# and current request (e.g groups are annotated with 'admin' if the
|
239
|
-
# currently logged in user is an admin of the group)
|
239
|
+
# currently logged in user is an admin of the group). nils are removed
|
240
|
+
# from the list.
|
240
241
|
result = Elastic.search(query)
|
241
242
|
records = @klass.find_by_id(result[HITS][HITS].map {|entry| entry[ID]}) || []
|
242
243
|
{
|
243
244
|
total: result[HITS][TOTAL] || 0,
|
244
|
-
results: block_given? ? records.map {|record| yield record} : records
|
245
|
+
results: block_given? ? (records.map {|record| yield record}).compact : records
|
245
246
|
}
|
246
247
|
end
|
247
248
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: co-elastic-query
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen von Takach
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|