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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 179a4d4e2b43118c16cf20b7b553b89088958932
4
- data.tar.gz: b85906f9adac8e836bc3cbcb6f1a731f427e7b04
3
+ metadata.gz: 9bd337a7275ec8cec28308fad9de92bf3a0c6564
4
+ data.tar.gz: 457927186441945763961a96ec56ecaf563e3be7
5
5
  SHA512:
6
- metadata.gz: a220dd800f14e74519faf3bdb18658db8f17bc4275cff91b1614d90fb9d5affb031126e97cbbc2b4ac2c70fc3223c162adb31e9f6e6a58d74850787dce736204
7
- data.tar.gz: e6dd6ad3667acd318aa8a41182404ea3bdd9a8d0e8aa0a3ae2318266b0193683c33e34c70797f67793513fdc169ff24308b74432e2e84e901ef7675b21da5122
6
+ metadata.gz: 848c7bcfce64a91f66a998461773148d74a7e3850de9ab553546aced805bdca7805b105f65a1138d65206cd2c645b8cb5ef9811c0cd09fb66fe25a1c907528f5
7
+ data.tar.gz: d7aa50ade0d46c16978b56611f53b1d6eb57df3ce34f46b97b96a08fb8200a0d1d80d6cde2e88fe2dffcc3c140efb88220ae8dbbb42ae98f23b2d82920793976
@@ -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
@@ -1,3 +1,3 @@
1
1
  module CoElasticQuery
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  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.2
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-09-27 00:00:00.000000000 Z
12
+ date: 2014-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler