data_tables 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/data_tables.rb +3 -2
  2. metadata +3 -3
data/lib/data_tables.rb CHANGED
@@ -59,7 +59,7 @@ module DataTablesController
59
59
  current_page = (params[:iDisplayStart].to_i/params[:iDisplayLength].to_i rescue 0) + 1
60
60
  objects = nil
61
61
  if search_condition.nil?
62
- objects = records.sort_by(columns[sort_column][:name].to_sym, :order=>"ALPHA " + params[:sSortDir_0].capitalize, :limit=>params[:iDisplayLength].to_i, :start=>(params[:iDisplayStart].to_i))
62
+ objects = records.sort_by(columns[sort_column][:name].to_sym, :order=>"ALPHA " + params[:sSortDir_0].capitalize, :limit=>[params[:iDisplayStart].to_i, params[:iDisplayLength].to_i])
63
63
  total_display_records = total_records
64
64
  else
65
65
  options = {}
@@ -68,7 +68,8 @@ module DataTablesController
68
68
  options[:fuzzy] = {columns[sort_column][:name].to_sym => search_condition}
69
69
  objects = Lunar.search(modelCls, options)
70
70
  total_display_records = objects.size
71
- objects = objects.sort(:by => columns[sort_column][:name].to_sym, :order=>"ALPHA " + params[:sSortDir_0].capitalize, :limit=>params[:iDisplayLength].to_i, :start=>(params[:iDisplayStart].to_i))
71
+ objects = objects.sort(:by => columns[sort_column][:name].to_sym, :order=>"ALPHA " + params[:sSortDir_0].capitalize, :limit=>[params[:iDisplayStart].to_i, params[:iDisplayLength].to_i])
72
+ raise
72
73
  end
73
74
  data = objects.collect do |instance|
74
75
  columns.collect { |column| datatables_instance_get_value(instance, column) }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_tables
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Duane Compton