data_table 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,4 @@ pkg/*
2
2
  *.gem
3
3
  .bundle
4
4
  *.swp
5
+ bin
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use 1.9.2-p290@data_table
1
+ rvm use 1.9.3@data_table
data/Gemfile.lock CHANGED
@@ -1,76 +1,76 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- data_table (0.4.1)
4
+ data_table (0.4.3)
5
5
  rails (~> 3.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionmailer (3.2.3)
11
- actionpack (= 3.2.3)
10
+ actionmailer (3.2.8)
11
+ actionpack (= 3.2.8)
12
12
  mail (~> 2.4.4)
13
- actionpack (3.2.3)
14
- activemodel (= 3.2.3)
15
- activesupport (= 3.2.3)
13
+ actionpack (3.2.8)
14
+ activemodel (= 3.2.8)
15
+ activesupport (= 3.2.8)
16
16
  builder (~> 3.0.0)
17
17
  erubis (~> 2.7.0)
18
- journey (~> 1.0.1)
18
+ journey (~> 1.0.4)
19
19
  rack (~> 1.4.0)
20
20
  rack-cache (~> 1.2)
21
21
  rack-test (~> 0.6.1)
22
- sprockets (~> 2.1.2)
23
- activemodel (3.2.3)
24
- activesupport (= 3.2.3)
22
+ sprockets (~> 2.1.3)
23
+ activemodel (3.2.8)
24
+ activesupport (= 3.2.8)
25
25
  builder (~> 3.0.0)
26
- activerecord (3.2.3)
27
- activemodel (= 3.2.3)
28
- activesupport (= 3.2.3)
26
+ activerecord (3.2.8)
27
+ activemodel (= 3.2.8)
28
+ activesupport (= 3.2.8)
29
29
  arel (~> 3.0.2)
30
30
  tzinfo (~> 0.3.29)
31
- activeresource (3.2.3)
32
- activemodel (= 3.2.3)
33
- activesupport (= 3.2.3)
34
- activesupport (3.2.3)
31
+ activeresource (3.2.8)
32
+ activemodel (= 3.2.8)
33
+ activesupport (= 3.2.8)
34
+ activesupport (3.2.8)
35
35
  i18n (~> 0.6)
36
36
  multi_json (~> 1.0)
37
37
  arel (3.0.2)
38
- builder (3.0.0)
38
+ builder (3.0.4)
39
39
  diff-lcs (1.1.2)
40
40
  erubis (2.7.0)
41
41
  hike (1.2.1)
42
- i18n (0.6.0)
43
- journey (1.0.3)
44
- json (1.6.6)
42
+ i18n (0.6.1)
43
+ journey (1.0.4)
44
+ json (1.7.5)
45
45
  mail (2.4.4)
46
46
  i18n (>= 0.4.0)
47
47
  mime-types (~> 1.16)
48
48
  treetop (~> 1.4.8)
49
- mime-types (1.18)
50
- multi_json (1.2.0)
49
+ mime-types (1.19)
50
+ multi_json (1.3.6)
51
51
  polyglot (0.3.3)
52
52
  rack (1.4.1)
53
53
  rack-cache (1.2)
54
54
  rack (>= 0.4)
55
55
  rack-ssl (1.3.2)
56
56
  rack
57
- rack-test (0.6.1)
57
+ rack-test (0.6.2)
58
58
  rack (>= 1.0)
59
- rails (3.2.3)
60
- actionmailer (= 3.2.3)
61
- actionpack (= 3.2.3)
62
- activerecord (= 3.2.3)
63
- activeresource (= 3.2.3)
64
- activesupport (= 3.2.3)
59
+ rails (3.2.8)
60
+ actionmailer (= 3.2.8)
61
+ actionpack (= 3.2.8)
62
+ activerecord (= 3.2.8)
63
+ activeresource (= 3.2.8)
64
+ activesupport (= 3.2.8)
65
65
  bundler (~> 1.0)
66
- railties (= 3.2.3)
67
- railties (3.2.3)
68
- actionpack (= 3.2.3)
69
- activesupport (= 3.2.3)
66
+ railties (= 3.2.8)
67
+ railties (3.2.8)
68
+ actionpack (= 3.2.8)
69
+ activesupport (= 3.2.8)
70
70
  rack-ssl (~> 1.3.2)
71
71
  rake (>= 0.8.7)
72
72
  rdoc (~> 3.4)
73
- thor (~> 0.14.6)
73
+ thor (>= 0.14.6, < 2.0)
74
74
  rake (0.9.2.2)
75
75
  rdoc (3.12)
76
76
  json (~> 1.4)
@@ -86,16 +86,16 @@ GEM
86
86
  rspec-core (~> 2.0.1)
87
87
  rspec-expectations (~> 2.0.1)
88
88
  shoulda (2.11.3)
89
- sprockets (2.1.2)
89
+ sprockets (2.1.3)
90
90
  hike (~> 1.2)
91
91
  rack (~> 1.0)
92
92
  tilt (~> 1.1, != 1.3.0)
93
- thor (0.14.6)
93
+ thor (0.16.0)
94
94
  tilt (1.3.3)
95
- treetop (1.4.10)
95
+ treetop (1.4.12)
96
96
  polyglot
97
97
  polyglot (>= 0.3.1)
98
- tzinfo (0.3.32)
98
+ tzinfo (0.3.34)
99
99
 
100
100
  PLATFORMS
101
101
  ruby
@@ -25,7 +25,12 @@ module DataTable
25
25
  {search_fields.first => {"$all" => terms.map {|term| /#{term}/i }}}
26
26
  end
27
27
  else
28
- {"$or" => search_fields.map {|field| {field => /#{query}/i} }}
28
+ terms = query.split(/\s+/)
29
+ terms_and_fields = terms.map do |term|
30
+ {"$or" => search_fields.map {|field| {field => /#{term}/i} }}
31
+ end
32
+
33
+ {"$and" => terms_and_fields}
29
34
  end
30
35
  end
31
36
 
@@ -1,3 +1,3 @@
1
1
  module DataTable
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,67 +1,87 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: data_table
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.2
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 4
8
+ - 3
9
+ version: 0.4.3
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Jason Dew
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-04-03 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rails
16
- requirement: &70103816205680 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '3.0'
16
+
17
+ date: 2012-10-31 00:00:00 -04:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
22
21
  type: :runtime
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ segments:
27
+ - 3
28
+ - 0
29
+ version: "3.0"
30
+ name: rails
31
+ requirement: *id001
23
32
  prerelease: false
24
- version_requirements: *70103816205680
25
- - !ruby/object:Gem::Dependency
26
- name: rspec
27
- requirement: &70103816204540 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
33
+ - !ruby/object:Gem::Dependency
34
+ type: :development
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
30
37
  - - ~>
31
- - !ruby/object:Gem::Version
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 2
41
+ - 0
42
+ - 0
32
43
  version: 2.0.0
33
- type: :development
44
+ name: rspec
45
+ requirement: *id002
34
46
  prerelease: false
35
- version_requirements: *70103816204540
36
- - !ruby/object:Gem::Dependency
37
- name: shoulda
38
- requirement: &70103816203880 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
47
+ - !ruby/object:Gem::Dependency
48
+ type: :development
49
+ version_requirements: &id003 !ruby/object:Gem::Requirement
50
+ requirements:
41
51
  - - ~>
42
- - !ruby/object:Gem::Version
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 2
55
+ - 11
56
+ - 0
43
57
  version: 2.11.0
44
- type: :development
58
+ name: shoulda
59
+ requirement: *id003
45
60
  prerelease: false
46
- version_requirements: *70103816203880
47
- - !ruby/object:Gem::Dependency
48
- name: rr
49
- requirement: &70103816203420 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
61
+ - !ruby/object:Gem::Dependency
62
+ type: :development
63
+ version_requirements: &id004 !ruby/object:Gem::Requirement
64
+ requirements:
52
65
  - - ~>
53
- - !ruby/object:Gem::Version
66
+ - !ruby/object:Gem::Version
67
+ segments:
68
+ - 1
69
+ - 0
70
+ - 0
54
71
  version: 1.0.0
55
- type: :development
72
+ name: rr
73
+ requirement: *id004
56
74
  prerelease: false
57
- version_requirements: *70103816203420
58
75
  description: Simple data preparation from AR/Mongoid to the jQuery DataTables plugin
59
- email:
76
+ email:
60
77
  - jason.dew@gmail.com
61
78
  executables: []
79
+
62
80
  extensions: []
81
+
63
82
  extra_rdoc_files: []
64
- files:
83
+
84
+ files:
65
85
  - .gitignore
66
86
  - .rvmrc
67
87
  - Gemfile
@@ -82,31 +102,37 @@ files:
82
102
  - spec/data_table_spec.rb
83
103
  - spec/mongoid_data_table_spec.rb
84
104
  - spec/spec_helper.rb
105
+ has_rdoc: true
85
106
  homepage: http://rubygems.org/gems/data_table
86
107
  licenses: []
108
+
87
109
  post_install_message:
88
110
  rdoc_options: []
89
- require_paths:
111
+
112
+ require_paths:
90
113
  - lib
91
- required_ruby_version: !ruby/object:Gem::Requirement
92
- none: false
93
- requirements:
94
- - - ! '>='
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- required_rubygems_version: !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
100
- - - ! '>='
101
- - !ruby/object:Gem::Version
102
- version: '0'
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ segments:
119
+ - 0
120
+ version: "0"
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ segments:
126
+ - 0
127
+ version: "0"
103
128
  requirements: []
129
+
104
130
  rubyforge_project: data_table
105
- rubygems_version: 1.8.10
131
+ rubygems_version: 1.3.6
106
132
  signing_key:
107
133
  specification_version: 3
108
134
  summary: Simple data preparation from AR/Mongoid to the jQuery DataTables plugin
109
- test_files:
135
+ test_files:
110
136
  - spec/active_record_data_table_spec.rb
111
137
  - spec/data_table_spec.rb
112
138
  - spec/mongoid_data_table_spec.rb