data_table 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- data_table (0.3.1)
4
+ data_table (0.3.2)
5
5
  rails (~> 3.0.0)
6
6
 
7
7
  GEM
@@ -19,7 +19,7 @@ module DataTable
19
19
  terms = query.strip.split(/\s+/)
20
20
 
21
21
  if terms.size == 1
22
- {search_fields.first => /#{query}/i}
22
+ {search_fields.first => /#{terms.first}/i}
23
23
  else
24
24
  {search_fields.first => {"$all" => terms.map {|term| /#{term}/i }}}
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module DataTable
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -41,6 +41,10 @@ describe DataTable do
41
41
  it "should require a match for each term when there is a single search field" do
42
42
  send(:_where_conditions, "q1 q2", %w(f)).should == {"f" => {"$all" => [/q1/i, /q2/i]}}
43
43
  end
44
+
45
+ it "should require a match for each term when there is a single search field with spaces at the end" do
46
+ send(:_where_conditions, "q1 ", %w(f)).should == {"f" => /q1/i}
47
+ end
44
48
  end
45
49
 
46
50
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: data_table
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.2
5
+ version: 0.3.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jason Dew