mongo-search 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module MongoSearch
7
7
 
8
8
  def call(params)
9
9
  filters = {}
10
- filters[@attr] = params[@attr] if params[@attr]
10
+ filters[@attr] = params[@attr] if params[@attr] && !params[@attr].empty?
11
11
  filters
12
12
  end
13
13
  end
@@ -11,7 +11,7 @@ module MongoSearch
11
11
 
12
12
  def call(params)
13
13
  filters = {}
14
- filters[@field] = {@operator => @conv.call(params[@attr])} if params[@attr]
14
+ filters[@field] = {@operator => @conv.call(params[@attr])} if params[@attr] && !params[@attr].empty?
15
15
  filters
16
16
  end
17
17
  end
@@ -8,7 +8,7 @@ module MongoSearch
8
8
  def call(params)
9
9
  filters = {}
10
10
 
11
- if params[@attr]
11
+ if params[@attr] && !params[@attr].empty?
12
12
  value = params[@attr]
13
13
  filters[@attr] = {:$all => Converters[:array].call(value)}
14
14
  end
@@ -11,7 +11,7 @@ module MongoSearch
11
11
 
12
12
  def call(params)
13
13
  filters = {}
14
- filters[@field] = {@operator => @conv.call(params[@attr])} if params[@attr]
14
+ filters[@field] = {@operator => @conv.call(params[@attr])} if params[@attr] && !params[@attr].empty?
15
15
  filters
16
16
  end
17
17
  end
@@ -7,7 +7,7 @@ module MongoSearch
7
7
 
8
8
  def call(params)
9
9
  filters = {}
10
- filters[@attr] = /#{Regexp.escape(params[@attr])}/i if params[@attr]
10
+ filters[@attr] = /#{Regexp.escape(params[@attr])}/i if params[@attr] && !params[@attr].empty?
11
11
  filters
12
12
  end
13
13
  end
@@ -1,5 +1,5 @@
1
1
  module Mongo
2
2
  module Search
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-05-22 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &70097252840100 !ruby/object:Gem::Requirement
17
+ requirement: &70349984450400 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *70097252840100
25
+ version_requirements: *70349984450400
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: guard
28
- requirement: &70097252839420 !ruby/object:Gem::Requirement
28
+ requirement: &70349984449940 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *70097252839420
36
+ version_requirements: *70349984449940
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: guard-rspec
39
- requirement: &70097252838860 !ruby/object:Gem::Requirement
39
+ requirement: &70349984449320 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70097252838860
47
+ version_requirements: *70349984449320
48
48
  description:
49
49
  email:
50
50
  - abril_vejasp_dev@thoughtworks.com