data_tables 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- data/data_tables.gemspec +1 -1
- data/lib/data_tables.rb +1 -5
- metadata +2 -2
data/data_tables.gemspec
CHANGED
data/lib/data_tables.rb
CHANGED
@@ -61,7 +61,6 @@ module DataTablesController
|
|
61
61
|
search_condition = params[:sSearch].blank? ? nil : params[:sSearch].to_s
|
62
62
|
|
63
63
|
sort_column = params[:iSortCol_0].to_i
|
64
|
-
sort_column = 1 if sort_column == 0
|
65
64
|
current_page = (params[:iDisplayStart].to_i/params[:iDisplayLength].to_i rescue 0) + 1
|
66
65
|
per_page = params[:iDisplayLength] || 10
|
67
66
|
per_page = per_page.to_i
|
@@ -196,7 +195,6 @@ module DataTablesController
|
|
196
195
|
condstr = nil
|
197
196
|
unless params[:sSearch].blank?
|
198
197
|
sort_column_id = params[:iSortCol_0].to_i
|
199
|
-
sort_column_id = 1 if sort_column_id == 0
|
200
198
|
sort_column = columns[sort_column_id]
|
201
199
|
if sort_column && sort_column.has_key?(:attribute)
|
202
200
|
condstr = params[:sSearch].gsub(/_/, '\\\\_').gsub(/%/, '\\\\%')
|
@@ -221,7 +219,7 @@ module DataTablesController
|
|
221
219
|
except.each do |expt|
|
222
220
|
must_not { term expt[0].to_sym, expt[1].to_s }
|
223
221
|
end
|
224
|
-
end
|
222
|
+
end
|
225
223
|
end
|
226
224
|
filter(:term, domain: domain_name) unless domain_name.blank?
|
227
225
|
es_block.call(self) if es_block.respond_to?(:call)
|
@@ -264,7 +262,6 @@ module DataTablesController
|
|
264
262
|
condition_local = ''
|
265
263
|
unless params[:sSearch].blank?
|
266
264
|
sort_column_id = params[:iSortCol_0].to_i
|
267
|
-
sort_column_id = 1 if sort_column_id == 0
|
268
265
|
sort_column = columns[sort_column_id]
|
269
266
|
condstr = params[:sSearch].strip.gsub(/_/, '\\\\_').gsub(/%/, '\\\\%')
|
270
267
|
|
@@ -306,7 +303,6 @@ module DataTablesController
|
|
306
303
|
total_display_records = modelCls.count :conditions => conditions.join(" AND ")
|
307
304
|
end
|
308
305
|
sort_column = params[:iSortCol_0].to_i
|
309
|
-
sort_column = 1 if sort_column == 0
|
310
306
|
current_page = (params[:iDisplayStart].to_i/params[:iDisplayLength].to_i rescue 0)+1
|
311
307
|
if named_scope
|
312
308
|
objects = modelCls.send(named_scope, *args).paginate(:page => current_page,
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: data_tables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.14
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Duane Compton
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-08-
|
16
|
+
date: 2013-08-20 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
type: :development
|