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 +1 -0
- data/.rvmrc +1 -1
- data/Gemfile.lock +39 -39
- data/lib/data_table/mongoid.rb +6 -1
- data/lib/data_table/version.rb +1 -1
- metadata +83 -57
data/.gitignore
CHANGED
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use 1.9.
|
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.
|
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.
|
11
|
-
actionpack (= 3.2.
|
10
|
+
actionmailer (3.2.8)
|
11
|
+
actionpack (= 3.2.8)
|
12
12
|
mail (~> 2.4.4)
|
13
|
-
actionpack (3.2.
|
14
|
-
activemodel (= 3.2.
|
15
|
-
activesupport (= 3.2.
|
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.
|
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.
|
23
|
-
activemodel (3.2.
|
24
|
-
activesupport (= 3.2.
|
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.
|
27
|
-
activemodel (= 3.2.
|
28
|
-
activesupport (= 3.2.
|
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.
|
32
|
-
activemodel (= 3.2.
|
33
|
-
activesupport (= 3.2.
|
34
|
-
activesupport (3.2.
|
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.
|
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.
|
43
|
-
journey (1.0.
|
44
|
-
json (1.
|
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.
|
50
|
-
multi_json (1.
|
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.
|
57
|
+
rack-test (0.6.2)
|
58
58
|
rack (>= 1.0)
|
59
|
-
rails (3.2.
|
60
|
-
actionmailer (= 3.2.
|
61
|
-
actionpack (= 3.2.
|
62
|
-
activerecord (= 3.2.
|
63
|
-
activeresource (= 3.2.
|
64
|
-
activesupport (= 3.2.
|
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.
|
67
|
-
railties (3.2.
|
68
|
-
actionpack (= 3.2.
|
69
|
-
activesupport (= 3.2.
|
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 (
|
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.
|
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.
|
93
|
+
thor (0.16.0)
|
94
94
|
tilt (1.3.3)
|
95
|
-
treetop (1.4.
|
95
|
+
treetop (1.4.12)
|
96
96
|
polyglot
|
97
97
|
polyglot (>= 0.3.1)
|
98
|
-
tzinfo (0.3.
|
98
|
+
tzinfo (0.3.34)
|
99
99
|
|
100
100
|
PLATFORMS
|
101
101
|
ruby
|
data/lib/data_table/mongoid.rb
CHANGED
@@ -25,7 +25,12 @@ module DataTable
|
|
25
25
|
{search_fields.first => {"$all" => terms.map {|term| /#{term}/i }}}
|
26
26
|
end
|
27
27
|
else
|
28
|
-
|
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
|
|
data/lib/data_table/version.rb
CHANGED
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
|
-
|
5
|
-
|
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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
44
|
+
name: rspec
|
45
|
+
requirement: *id002
|
34
46
|
prerelease: false
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
58
|
+
name: shoulda
|
59
|
+
requirement: *id003
|
45
60
|
prerelease: false
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
111
|
+
|
112
|
+
require_paths:
|
90
113
|
- lib
|
91
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
requirements:
|
100
|
-
- -
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
|
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.
|
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
|