mongoid-report 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/mongoid/report/scope.rb +2 -2
- data/lib/mongoid/report/version.rb +1 -1
- data/spec/mongoid/report/aggregation_spec.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTc1MDVkMjAwOGQ1MTRlM2E0NWQ2ZDk4ODE4MjllZjEzZGRmYWJhMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDc5ZDViNjhhZmFkZTQ1MzBiZWYwYzVmNTVhYzUzYTM3ZDBjNGYxNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzZjMTZiYjc4NDJjOWRkM2VmYjg3NDYwZWUxNWY1MzNhNTg4NzFlODczYTkz
|
10
|
+
ZTdiYmEzYjUxMzNhY2Q5OWYyNTY4NTIzMjZiOTljNjI2ZWYwZDBkMmVhM2Qw
|
11
|
+
MWY1ZjBmY2YxNWI2Y2Y2ZjJlNWNjYjJiMjhmOGJmMDVkZjhlNDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODMzNGM5YmRlMzhlODVhMWI0MDE4MWEwMzdjMjkwMWI4MGJlNDU5NWY2OWJi
|
14
|
+
ODlkMTA2Y2MwMjk4YmJiNzkwMTRiNTBhN2E2Yjg4OWMwYWVjMzU0YTI3ZGFl
|
15
|
+
N2I1OTMyNjEyMDJlMjc2NzJhNTkyNTY4Yjk4NzQzZTAyMjA0MDM=
|
data/Gemfile.lock
CHANGED
data/lib/mongoid/report/scope.rb
CHANGED
@@ -62,5 +62,20 @@ describe Mongoid::Report do
|
|
62
62
|
expect(rows[1]['field1']).to eq(1)
|
63
63
|
expect(rows[1]['day']).to eq(yesterday)
|
64
64
|
end
|
65
|
+
|
66
|
+
it 'skips empty match in query' do
|
67
|
+
klass.create(day: today , field1: 1 , field2: 2)
|
68
|
+
|
69
|
+
example = Report3.new
|
70
|
+
scope = example.aggregate_for(Model)
|
71
|
+
scope = scope.query()
|
72
|
+
scope = scope.query({})
|
73
|
+
|
74
|
+
rows = scope.all
|
75
|
+
|
76
|
+
expect(rows.size).to eq(1)
|
77
|
+
expect(rows[0]['field1']).to eq(1)
|
78
|
+
expect(rows[0]['day']).to eq(today)
|
79
|
+
end
|
65
80
|
end
|
66
81
|
end
|