mongoid-filterable 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid-filterable/filterable.rb +1 -1
- data/lib/mongoid-filterable/version.rb +1 -1
- data/spec/filterable_spec.rb +10 -0
- 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: 87d7798ec085fc87bdc881c9b1e558ba586ca6b4
|
4
|
+
data.tar.gz: 312d99250344d91691699abf7df77da2e92c6fbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1779d49149024d0414944056fca200d6dbe09107c253f219fba32db7f1bd7e0eeb41498e1539e2a8d87f2eea159f42b5812e8980ed0bf511610d871094d11b7a
|
7
|
+
data.tar.gz: 3f105856c09b016d5805589f7f6cc551b072ad4b2d89adcd1ae83729830012f9e78256ec122b7421755c1ea0125f996f0bb26d65512aca179ff82f587b2b9073
|
data/spec/filterable_spec.rb
CHANGED
@@ -122,4 +122,14 @@ describe Mongoid::Filterable do
|
|
122
122
|
expect(City.filter(people_in: [500, 100]).count).to eq(2)
|
123
123
|
end
|
124
124
|
end
|
125
|
+
|
126
|
+
context 'when filter is applied on a scope' do
|
127
|
+
it 'previous scope is maintained' do
|
128
|
+
City.create(name: '2', people: 100)
|
129
|
+
City.create(name: '1', people: 500)
|
130
|
+
City.create(name: '1', people: 1000)
|
131
|
+
City.create(name: '1', people: 1000)
|
132
|
+
expect(City.where(name: '2').filter(nil).count).to eq(1)
|
133
|
+
end
|
134
|
+
end
|
125
135
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-filterable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Jurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|