fancygrid 2.0.7 → 2.0.8
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.
- checksums.yaml +15 -0
- data/Gemfile.lock +70 -92
- data/README.md +35 -21
- data/Rakefile +36 -31
- data/VERSION +1 -1
- data/config/locales/fancygrid.de.yml +5 -2
- data/config/locales/fancygrid.en.yml +5 -2
- data/fancygrid.gemspec +5 -4
- data/lib/fancygrid/orm/sql_generator.rb +12 -2
- metadata +5 -20
checksums.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
OTQ0YTdiMjUzMWIzNDRmMWM3N2M1YTUzZjNkYjIwYzNkOWJmZmM5OQ==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
NWJmM2U3NzkxNzRjNGQzZmZhNzcwNzI2NDcwNTNlNmI2MTE2MmVjNA==
|
|
7
|
+
SHA512:
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
MjkzZTIzNjNjOWNjOWExY2E5ZDE5NWJhMDlmMWQzNjYxMjUxM2I4MzNjYmJl
|
|
10
|
+
NjJhMTNkYzEwZDRjNDI5Yzg3OGUwNmE4MTY3NDZkZThkNzI5MDExMmY3YmFi
|
|
11
|
+
MzQ3ZDhjZTM5OTg2MzE1OWI1OTJkOGY3NTVjMzA3YjZmNTAwMGI=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
MDVjYmE2Mzg4ODJhYTQ0NWQxMWM2ZTJlMGFlZTMzYWRjOWY3YTY3ODJmOWE0
|
|
14
|
+
YjFlNWJlYzJiNDdmYjIzMDIwZGU3Mzc3YmVkZTkxZGZiZWQwZDg5NzViYzIw
|
|
15
|
+
MjI2ZGNkMjVmZDk1ODliOGE2NTU4MjVjZThiNDBjM2Y5ZDk0MGQ=
|
data/Gemfile.lock
CHANGED
|
@@ -1,103 +1,81 @@
|
|
|
1
1
|
GEM
|
|
2
2
|
remote: http://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
actionmailer (3.2
|
|
5
|
-
actionpack (= 3.2
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
activesupport (= 3.2
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
sprockets (~> 2.1.2)
|
|
17
|
-
activemodel (3.2.0)
|
|
18
|
-
activesupport (= 3.2.0)
|
|
19
|
-
builder (~> 3.0.0)
|
|
20
|
-
activerecord (3.2.0)
|
|
21
|
-
activemodel (= 3.2.0)
|
|
22
|
-
activesupport (= 3.2.0)
|
|
23
|
-
arel (~> 3.0.0)
|
|
24
|
-
tzinfo (~> 0.3.29)
|
|
25
|
-
activeresource (3.2.0)
|
|
26
|
-
activemodel (= 3.2.0)
|
|
27
|
-
activesupport (= 3.2.0)
|
|
28
|
-
activesupport (3.2.0)
|
|
29
|
-
i18n (~> 0.6)
|
|
30
|
-
multi_json (~> 1.0)
|
|
31
|
-
arel (3.0.2)
|
|
32
|
-
builder (3.0.0)
|
|
4
|
+
actionmailer (2.3.2)
|
|
5
|
+
actionpack (= 2.3.2)
|
|
6
|
+
actionpack (2.3.2)
|
|
7
|
+
activesupport (= 2.3.2)
|
|
8
|
+
activerecord (2.3.2)
|
|
9
|
+
activesupport (= 2.3.2)
|
|
10
|
+
activeresource (2.3.2)
|
|
11
|
+
activesupport (= 2.3.2)
|
|
12
|
+
activesupport (2.3.2)
|
|
13
|
+
addressable (2.3.5)
|
|
14
|
+
builder (3.2.2)
|
|
15
|
+
descendants_tracker (0.0.3)
|
|
33
16
|
diff-lcs (1.1.3)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
17
|
+
faraday (0.9.0)
|
|
18
|
+
multipart-post (>= 1.2, < 3)
|
|
19
|
+
git (1.2.6)
|
|
20
|
+
github_api (0.11.3)
|
|
21
|
+
addressable (~> 2.3)
|
|
22
|
+
descendants_tracker (~> 0.0.1)
|
|
23
|
+
faraday (~> 0.8, < 0.10)
|
|
24
|
+
hashie (>= 1.2)
|
|
25
|
+
multi_json (>= 1.7.5, < 2.0)
|
|
26
|
+
nokogiri (~> 1.6.0)
|
|
27
|
+
oauth2
|
|
28
|
+
haml (4.0.5)
|
|
29
|
+
tilt
|
|
30
|
+
hashie (2.0.5)
|
|
31
|
+
highline (1.6.21)
|
|
32
|
+
jeweler (2.0.1)
|
|
33
|
+
builder
|
|
34
|
+
bundler (>= 1.0)
|
|
41
35
|
git (>= 1.2.5)
|
|
36
|
+
github_api
|
|
37
|
+
highline (>= 1.6.15)
|
|
38
|
+
nokogiri (>= 1.5.10)
|
|
42
39
|
rake
|
|
43
|
-
|
|
44
|
-
json (1.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
rack (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
activesupport (= 3.2.0)
|
|
70
|
-
rack-ssl (~> 1.3.2)
|
|
71
|
-
rake (>= 0.8.7)
|
|
72
|
-
rdoc (~> 3.4)
|
|
73
|
-
thor (~> 0.14.6)
|
|
74
|
-
rake (0.9.2.2)
|
|
75
|
-
rdoc (3.12)
|
|
40
|
+
rdoc
|
|
41
|
+
json (1.8.1)
|
|
42
|
+
jwt (0.1.11)
|
|
43
|
+
multi_json (>= 1.5)
|
|
44
|
+
mini_portile (0.5.2)
|
|
45
|
+
multi_json (1.9.0)
|
|
46
|
+
multi_xml (0.5.5)
|
|
47
|
+
multipart-post (2.0.0)
|
|
48
|
+
nokogiri (1.6.1)
|
|
49
|
+
mini_portile (~> 0.5.0)
|
|
50
|
+
oauth2 (0.9.3)
|
|
51
|
+
faraday (>= 0.8, < 0.10)
|
|
52
|
+
jwt (~> 0.1.8)
|
|
53
|
+
multi_json (~> 1.3)
|
|
54
|
+
multi_xml (~> 0.5)
|
|
55
|
+
rack (~> 1.2)
|
|
56
|
+
rack (1.5.2)
|
|
57
|
+
rails (2.3.2)
|
|
58
|
+
actionmailer (= 2.3.2)
|
|
59
|
+
actionpack (= 2.3.2)
|
|
60
|
+
activerecord (= 2.3.2)
|
|
61
|
+
activeresource (= 2.3.2)
|
|
62
|
+
activesupport (= 2.3.2)
|
|
63
|
+
rake (>= 0.8.3)
|
|
64
|
+
rake (10.1.1)
|
|
65
|
+
rdoc (4.1.1)
|
|
76
66
|
json (~> 1.4)
|
|
77
|
-
rspec (2.
|
|
78
|
-
rspec-core (~> 2.
|
|
79
|
-
rspec-expectations (~> 2.
|
|
80
|
-
rspec-mocks (~> 2.
|
|
81
|
-
rspec-core (2.
|
|
82
|
-
rspec-expectations (2.
|
|
67
|
+
rspec (2.1.0)
|
|
68
|
+
rspec-core (~> 2.1.0)
|
|
69
|
+
rspec-expectations (~> 2.1.0)
|
|
70
|
+
rspec-mocks (~> 2.1.0)
|
|
71
|
+
rspec-core (2.1.0)
|
|
72
|
+
rspec-expectations (2.1.0)
|
|
83
73
|
diff-lcs (~> 1.1.2)
|
|
84
|
-
rspec-mocks (2.
|
|
85
|
-
rspec-rails (2.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
rspec (~> 2.8.0)
|
|
90
|
-
sprockets (2.1.2)
|
|
91
|
-
hike (~> 1.2)
|
|
92
|
-
rack (~> 1.0)
|
|
93
|
-
tilt (~> 1.1, != 1.3.0)
|
|
94
|
-
sqlite3 (1.3.5)
|
|
95
|
-
thor (0.14.6)
|
|
96
|
-
tilt (1.3.3)
|
|
97
|
-
treetop (1.4.10)
|
|
98
|
-
polyglot
|
|
99
|
-
polyglot (>= 0.3.1)
|
|
100
|
-
tzinfo (0.3.31)
|
|
74
|
+
rspec-mocks (2.1.0)
|
|
75
|
+
rspec-rails (2.1.0)
|
|
76
|
+
rspec (~> 2.1.0)
|
|
77
|
+
sqlite3 (1.3.9)
|
|
78
|
+
tilt (2.0.0)
|
|
101
79
|
|
|
102
80
|
PLATFORMS
|
|
103
81
|
ruby
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Fancygrid mades it easy to create and render tables for database records in rail
|
|
|
4
4
|
* Ajax data fetch
|
|
5
5
|
* Pagination
|
|
6
6
|
* Simple search
|
|
7
|
-
* Complex search with
|
|
7
|
+
* Complex search with 20 different conditions
|
|
8
8
|
* Column sorting
|
|
9
9
|
* View state caching
|
|
10
10
|
* ActiveRecord supported. MongoDB coming (some day).
|
|
@@ -26,7 +26,7 @@ Run
|
|
|
26
26
|
bundle install
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
If you use Rails3 with asset pipeline enabled, you can just require the javascript and css
|
|
29
|
+
If you use Rails3 with asset pipeline enabled, you can just require the javascript and css
|
|
30
30
|
```
|
|
31
31
|
// = require fancygrid
|
|
32
32
|
```
|
|
@@ -40,10 +40,10 @@ Here is an example for a simple table for the Users model:
|
|
|
40
40
|
```ruby
|
|
41
41
|
# UsersController
|
|
42
42
|
def index
|
|
43
|
-
|
|
44
|
-
fancygrid_for :users do |g|
|
|
45
|
-
# specify attributes to display
|
|
46
|
-
g.attributes :id, :username, :email
|
|
43
|
+
|
|
44
|
+
fancygrid_for :users do |g|
|
|
45
|
+
# specify attributes to display
|
|
46
|
+
g.attributes :id, :username, :email
|
|
47
47
|
# specify the callback url for ajax loading
|
|
48
48
|
g.ajax_url = users_path
|
|
49
49
|
# finally call find to query the data
|
|
@@ -58,6 +58,20 @@ To render the fancygrid in the view, use the same name that you passed in the se
|
|
|
58
58
|
= fancygrid :users
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
### Changing default comparison operator
|
|
62
|
+
The default SQL string comparison operator is `LIKE '%term%'`. You can update this to Postgresql's case-insensitive `ILIKE` as seen below:
|
|
63
|
+
```ruby
|
|
64
|
+
def index
|
|
65
|
+
fancygrid_for :users do |g|
|
|
66
|
+
g.search_operator = :insensitive_like
|
|
67
|
+
g.attributes :id, :email, :created_at
|
|
68
|
+
# ...
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The LIKE options include `:like` (the default), `:starts_with`, `:ends_with`, `:insensitive_like`, `:insensitive_starts_with`, and `:insensitive_ends_with`.
|
|
74
|
+
|
|
61
75
|
### Static tables
|
|
62
76
|
If you dont want to have an ajax table, dont specify the ajax_url. The data will be
|
|
63
77
|
queried and the table will be rendered without pagination.
|
|
@@ -65,15 +79,15 @@ queried and the table will be rendered without pagination.
|
|
|
65
79
|
def index
|
|
66
80
|
fancygrid_for :users do |g|
|
|
67
81
|
# ...
|
|
68
|
-
g.attributes :id, :username, :email
|
|
82
|
+
g.attributes :id, :username, :email
|
|
69
83
|
# don't set the ajax_url and just call find
|
|
70
84
|
g.find
|
|
71
85
|
end
|
|
72
86
|
end
|
|
73
|
-
```
|
|
87
|
+
```
|
|
74
88
|
|
|
75
89
|
### Table names and model names
|
|
76
|
-
Usually fancygrid tries to resolve the models class and table name from given
|
|
90
|
+
Usually fancygrid tries to resolve the models class and table name from given
|
|
77
91
|
name. If you happen to use namespaced models, you must pass the class as an option.
|
|
78
92
|
```ruby
|
|
79
93
|
def index
|
|
@@ -113,7 +127,7 @@ To add a class or id to either the table, TR, or TD elements you add it to the f
|
|
|
113
127
|
## Define columns
|
|
114
128
|
To display attributes as columns use the #attributes method for setup like this:
|
|
115
129
|
```ruby
|
|
116
|
-
def index
|
|
130
|
+
def index
|
|
117
131
|
fancygrid_for :users do |g|
|
|
118
132
|
# ...
|
|
119
133
|
g.attributes :id, :email, :created_at
|
|
@@ -125,7 +139,7 @@ To display attributes as columns use the #attributes method for setup like this:
|
|
|
125
139
|
For everything else use the #columns method. You can have method names,
|
|
126
140
|
method chains and procs to resolve column values.
|
|
127
141
|
```ruby
|
|
128
|
-
def index
|
|
142
|
+
def index
|
|
129
143
|
fancygrid_for :users do |g|
|
|
130
144
|
# ...
|
|
131
145
|
# methods
|
|
@@ -135,7 +149,7 @@ method chains and procs to resolve column values.
|
|
|
135
149
|
# procs
|
|
136
150
|
g.columns :roles do |record|
|
|
137
151
|
record.roles.map(&:name).join(", ")
|
|
138
|
-
end
|
|
152
|
+
end
|
|
139
153
|
# ...
|
|
140
154
|
end
|
|
141
155
|
end
|
|
@@ -157,10 +171,10 @@ render all unformatted values.
|
|
|
157
171
|
= value
|
|
158
172
|
```
|
|
159
173
|
|
|
160
|
-
## belongs_to or has_one associations
|
|
174
|
+
## belongs_to or has_one associations
|
|
161
175
|
To define columns for associations, use the #columns_for method.
|
|
162
176
|
```ruby
|
|
163
|
-
def index
|
|
177
|
+
def index
|
|
164
178
|
fancygrid_for :users do |g|
|
|
165
179
|
# ...
|
|
166
180
|
g.columns_for :contact do |contact|
|
|
@@ -176,14 +190,14 @@ To define columns for associations, use the #columns_for method.
|
|
|
176
190
|
end
|
|
177
191
|
```
|
|
178
192
|
Mention that in the query block the contact_id is selected. This is required, since fancygrid
|
|
179
|
-
tries to use optimized sql queries by default. Therefore it will select only those attributes
|
|
193
|
+
tries to use optimized sql queries by default. Therefore it will select only those attributes
|
|
180
194
|
that have been used during the fancygrid setup. If the contact_id is missing, it will not be
|
|
181
195
|
possible to include the contact association.
|
|
182
196
|
|
|
183
|
-
If your association name is different from the models name, pass the model
|
|
197
|
+
If your association name is different from the models name, pass the model
|
|
184
198
|
class as option.
|
|
185
199
|
```ruby
|
|
186
|
-
def index
|
|
200
|
+
def index
|
|
187
201
|
fancygrid_for :users do |g|
|
|
188
202
|
# ...
|
|
189
203
|
g.columns_for :invoice_address, :class => Address do |adr|
|
|
@@ -195,22 +209,22 @@ class as option.
|
|
|
195
209
|
```
|
|
196
210
|
|
|
197
211
|
## has_many or has_and_belongs_to_many associations
|
|
198
|
-
If you have Users that has_many Orders, you should rather define a fancygrid
|
|
212
|
+
If you have Users that has_many Orders, you should rather define a fancygrid
|
|
199
213
|
for the Orders than for Users. However, if it must be a Users table and
|
|
200
214
|
you want to search on the associations attributes, you can do that:
|
|
201
215
|
|
|
202
216
|
```ruby
|
|
203
|
-
def index
|
|
217
|
+
def index
|
|
204
218
|
fancygrid_for :users do |g|
|
|
205
219
|
# ...
|
|
206
220
|
g.columns_for :roles do |roles|
|
|
207
|
-
roles.attributes :name
|
|
221
|
+
roles.attributes :name
|
|
208
222
|
end
|
|
209
223
|
# ...
|
|
210
224
|
end
|
|
211
225
|
end
|
|
212
226
|
```
|
|
213
|
-
|
|
227
|
+
|
|
214
228
|
The definition is valid, and you can already search for users with a specific
|
|
215
229
|
role. But nothing is going to be rendered in the roles.name column. This is
|
|
216
230
|
because roles is a collection of records, and not a single record. You can now
|
data/Rakefile
CHANGED
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
require 'rake'
|
|
1
|
+
# encoding: utf-8
|
|
3
2
|
|
|
3
|
+
require 'rubygems'
|
|
4
|
+
require 'bundler'
|
|
4
5
|
begin
|
|
5
|
-
|
|
6
|
-
rescue
|
|
7
|
-
puts
|
|
6
|
+
Bundler.setup(:default, :development)
|
|
7
|
+
rescue Bundler::BundlerError => e
|
|
8
|
+
$stderr.puts e.message
|
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
|
10
|
+
exit e.status_code
|
|
8
11
|
end
|
|
12
|
+
require 'rake'
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
gem.authors = ["Alexander Graefenstein"]
|
|
19
|
-
# gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
|
20
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
|
21
|
-
end
|
|
22
|
-
Jeweler::GemcutterTasks.new
|
|
23
|
-
rescue LoadError
|
|
24
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
|
14
|
+
require 'jeweler'
|
|
15
|
+
Jeweler::Tasks.new do |gem|
|
|
16
|
+
gem.name = "fancygrid"
|
|
17
|
+
gem.summary = %Q{Table rendering for rails applications}
|
|
18
|
+
gem.description = %Q{Enables easy table rendering in rails applications}
|
|
19
|
+
gem.email = "giniedp@online.de"
|
|
20
|
+
gem.homepage = "http://github.com/giniedp/fancygrid"
|
|
21
|
+
gem.authors = ["Alexander Graefenstein"]
|
|
25
22
|
end
|
|
23
|
+
Jeweler::RubygemsDotOrgTasks.new
|
|
24
|
+
|
|
25
|
+
#require 'rake/testtask'
|
|
26
|
+
#Rake::TestTask.new(:test) do |test|
|
|
27
|
+
# test.libs << 'lib' << 'test'
|
|
28
|
+
# test.pattern = 'test/**/test_*.rb'
|
|
29
|
+
# test.verbose = true
|
|
30
|
+
#end
|
|
31
|
+
#
|
|
32
|
+
#require 'rcov/rcovtask'
|
|
33
|
+
#Rcov::RcovTask.new do |test|
|
|
34
|
+
# test.libs << 'test'
|
|
35
|
+
# test.pattern = 'test/**/test_*.rb'
|
|
36
|
+
# test.verbose = true
|
|
37
|
+
# test.rcov_opts << '--exclude "gems/*"'
|
|
38
|
+
#end
|
|
39
|
+
#
|
|
40
|
+
#task :default => :test
|
|
26
41
|
|
|
27
|
-
require 'rake'
|
|
28
42
|
require 'rdoc/task'
|
|
29
|
-
|
|
30
|
-
require 'rspec/core'
|
|
31
|
-
require 'rspec/core/rake_task'
|
|
32
|
-
|
|
33
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
34
|
-
|
|
35
|
-
task :default => :spec
|
|
36
|
-
|
|
37
43
|
Rake::RDocTask.new do |rdoc|
|
|
38
44
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
|
39
45
|
|
|
40
46
|
rdoc.rdoc_dir = 'rdoc'
|
|
41
|
-
rdoc.title = "
|
|
42
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
|
47
|
+
rdoc.title = "test #{version}"
|
|
43
48
|
rdoc.rdoc_files.include('README*')
|
|
44
49
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
45
50
|
end
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.8
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
de:
|
|
2
2
|
fancygrid:
|
|
3
|
-
pagination:
|
|
3
|
+
pagination:
|
|
4
4
|
page: Seite
|
|
5
5
|
of: von
|
|
6
6
|
per_page: 'Pro Seite:'
|
|
@@ -18,7 +18,7 @@ de:
|
|
|
18
18
|
conditions: 'Alle kriterien müssen erfüllt sein:'
|
|
19
19
|
add_criterion: Kriterium hinzufügen
|
|
20
20
|
remove_criterion: Kriterium löschen
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
operator:
|
|
23
23
|
equal: 'gleich'
|
|
24
24
|
not_equal: 'ungleich'
|
|
@@ -29,6 +29,9 @@ de:
|
|
|
29
29
|
starts_with: 'beginnt mit'
|
|
30
30
|
ends_with: 'endet mit'
|
|
31
31
|
like: 'ähnlich wie'
|
|
32
|
+
insensitive_starts_with: 'beginnt mit (Groß-und Kleinschreibung)'
|
|
33
|
+
insensitive_ends_with: 'endet mit (Groß-und Kleinschreibung)'
|
|
34
|
+
insensitive_like: 'ähnlich wie (Groß-und Kleinschreibung)'
|
|
32
35
|
is_null: 'ist leer'
|
|
33
36
|
is_not_null: 'ist nicht leer'
|
|
34
37
|
is_true: 'ist wahr'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
en:
|
|
2
2
|
fancygrid:
|
|
3
|
-
pagination:
|
|
3
|
+
pagination:
|
|
4
4
|
page: Page
|
|
5
5
|
of: of
|
|
6
6
|
per_page: 'Per page:'
|
|
@@ -18,7 +18,7 @@ en:
|
|
|
18
18
|
conditions: 'All conditions must be met:'
|
|
19
19
|
add_criterion: Add criterion
|
|
20
20
|
remove_criterion: Remove criterion
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
operator:
|
|
23
23
|
equal: 'equal'
|
|
24
24
|
not_equal: 'not equal'
|
|
@@ -29,6 +29,9 @@ en:
|
|
|
29
29
|
starts_with: 'starts with'
|
|
30
30
|
ends_with: 'ends with'
|
|
31
31
|
like: 'like'
|
|
32
|
+
insensitive_starts_with: 'starts with (case-insensitive)'
|
|
33
|
+
insensitive_ends_with: 'ends with (case-insensitive)'
|
|
34
|
+
insensitive_like: 'like (case-insensitive)'
|
|
32
35
|
is_null: 'is null'
|
|
33
36
|
is_not_null: 'is not null'
|
|
34
37
|
is_true: 'is true'
|
data/fancygrid.gemspec
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
+
# stub: fancygrid 2.0.8 ruby lib
|
|
5
6
|
|
|
6
7
|
Gem::Specification.new do |s|
|
|
7
8
|
s.name = "fancygrid"
|
|
8
|
-
s.version = "2.0.
|
|
9
|
+
s.version = "2.0.8"
|
|
9
10
|
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
12
|
s.authors = ["Alexander Graefenstein"]
|
|
12
|
-
s.date = "
|
|
13
|
+
s.date = "2014-03-19"
|
|
13
14
|
s.description = "Enables easy table rendering in rails applications"
|
|
14
15
|
s.email = "giniedp@online.de"
|
|
15
16
|
s.extra_rdoc_files = [
|
|
@@ -92,11 +93,11 @@ Gem::Specification.new do |s|
|
|
|
92
93
|
]
|
|
93
94
|
s.homepage = "http://github.com/giniedp/fancygrid"
|
|
94
95
|
s.require_paths = ["lib"]
|
|
95
|
-
s.rubygems_version = "1.
|
|
96
|
+
s.rubygems_version = "2.1.10"
|
|
96
97
|
s.summary = "Table rendering for rails applications"
|
|
97
98
|
|
|
98
99
|
if s.respond_to? :specification_version then
|
|
99
|
-
s.specification_version =
|
|
100
|
+
s.specification_version = 4
|
|
100
101
|
|
|
101
102
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
102
103
|
s.add_runtime_dependency(%q<rails>, [">= 0"])
|
|
@@ -3,8 +3,9 @@ module Fancygrid
|
|
|
3
3
|
module SqlGenerator#:nodoc:
|
|
4
4
|
|
|
5
5
|
OPERATOR_NAMES = [
|
|
6
|
-
:equal, :not_equal, :less, :less_equal, :greater, :greater_equal, :starts_with, :ends_with,
|
|
7
|
-
:like, :
|
|
6
|
+
:equal, :not_equal, :less, :less_equal, :greater, :greater_equal, :starts_with, :ends_with,
|
|
7
|
+
:like, :insensitive_starts_with, :insensitive_ends_with, :insensitive_like,
|
|
8
|
+
:is_null, :is_not_null, :is_true, :is_not_true, :is_false, :is_not_false, :in, :not_in
|
|
8
9
|
]
|
|
9
10
|
|
|
10
11
|
attr_accessor :query_options
|
|
@@ -78,6 +79,15 @@ module Fancygrid
|
|
|
78
79
|
when "like"
|
|
79
80
|
value = "%#{value.to_param}%"
|
|
80
81
|
"LIKE"
|
|
82
|
+
when "insensitive_starts_with"
|
|
83
|
+
value = "#{value.to_param}%"
|
|
84
|
+
"ILIKE"
|
|
85
|
+
when "insensitive_ends_with"
|
|
86
|
+
value = "%#{value.to_param}"
|
|
87
|
+
"ILIKE"
|
|
88
|
+
when "insensitive_like"
|
|
89
|
+
value = "%#{value.to_param}%"
|
|
90
|
+
"ILIKE"
|
|
81
91
|
when "is_null"
|
|
82
92
|
value = nil
|
|
83
93
|
"IS NULL"
|
metadata
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fancygrid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 2.0.8
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Alexander Graefenstein
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: rails
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
none: false
|
|
18
16
|
requirements:
|
|
19
17
|
- - ! '>='
|
|
20
18
|
- !ruby/object:Gem::Version
|
|
@@ -22,7 +20,6 @@ dependencies:
|
|
|
22
20
|
type: :runtime
|
|
23
21
|
prerelease: false
|
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
-
none: false
|
|
26
23
|
requirements:
|
|
27
24
|
- - ! '>='
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
@@ -30,7 +27,6 @@ dependencies:
|
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
28
|
name: haml
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
30
|
requirements:
|
|
35
31
|
- - ! '>='
|
|
36
32
|
- !ruby/object:Gem::Version
|
|
@@ -38,7 +34,6 @@ dependencies:
|
|
|
38
34
|
type: :runtime
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
37
|
requirements:
|
|
43
38
|
- - ! '>='
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
@@ -46,7 +41,6 @@ dependencies:
|
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
|
47
42
|
name: sqlite3
|
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
none: false
|
|
50
44
|
requirements:
|
|
51
45
|
- - ! '>='
|
|
52
46
|
- !ruby/object:Gem::Version
|
|
@@ -54,7 +48,6 @@ dependencies:
|
|
|
54
48
|
type: :development
|
|
55
49
|
prerelease: false
|
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
51
|
requirements:
|
|
59
52
|
- - ! '>='
|
|
60
53
|
- !ruby/object:Gem::Version
|
|
@@ -62,7 +55,6 @@ dependencies:
|
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
|
63
56
|
name: rspec-rails
|
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
|
65
|
-
none: false
|
|
66
58
|
requirements:
|
|
67
59
|
- - ! '>='
|
|
68
60
|
- !ruby/object:Gem::Version
|
|
@@ -70,7 +62,6 @@ dependencies:
|
|
|
70
62
|
type: :development
|
|
71
63
|
prerelease: false
|
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
none: false
|
|
74
65
|
requirements:
|
|
75
66
|
- - ! '>='
|
|
76
67
|
- !ruby/object:Gem::Version
|
|
@@ -78,7 +69,6 @@ dependencies:
|
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
|
79
70
|
name: jeweler
|
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
|
81
|
-
none: false
|
|
82
72
|
requirements:
|
|
83
73
|
- - ! '>='
|
|
84
74
|
- !ruby/object:Gem::Version
|
|
@@ -86,7 +76,6 @@ dependencies:
|
|
|
86
76
|
type: :development
|
|
87
77
|
prerelease: false
|
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
-
none: false
|
|
90
79
|
requirements:
|
|
91
80
|
- - ! '>='
|
|
92
81
|
- !ruby/object:Gem::Version
|
|
@@ -173,29 +162,25 @@ files:
|
|
|
173
162
|
- spec/view_state_spec.rb
|
|
174
163
|
homepage: http://github.com/giniedp/fancygrid
|
|
175
164
|
licenses: []
|
|
165
|
+
metadata: {}
|
|
176
166
|
post_install_message:
|
|
177
167
|
rdoc_options: []
|
|
178
168
|
require_paths:
|
|
179
169
|
- lib
|
|
180
170
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
|
-
none: false
|
|
182
171
|
requirements:
|
|
183
172
|
- - ! '>='
|
|
184
173
|
- !ruby/object:Gem::Version
|
|
185
174
|
version: '0'
|
|
186
|
-
segments:
|
|
187
|
-
- 0
|
|
188
|
-
hash: -2428341050134457601
|
|
189
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
|
-
none: false
|
|
191
176
|
requirements:
|
|
192
177
|
- - ! '>='
|
|
193
178
|
- !ruby/object:Gem::Version
|
|
194
179
|
version: '0'
|
|
195
180
|
requirements: []
|
|
196
181
|
rubyforge_project:
|
|
197
|
-
rubygems_version: 1.
|
|
182
|
+
rubygems_version: 2.1.10
|
|
198
183
|
signing_key:
|
|
199
|
-
specification_version:
|
|
184
|
+
specification_version: 4
|
|
200
185
|
summary: Table rendering for rails applications
|
|
201
186
|
test_files: []
|