Skip to content
Browse files

Forced limit and offset to integers

  • Loading branch information...
1 parent 5bf6c93 commit 2015141c1ea807a00072b2166c47dba3c5519d88 @cajun-code cajun-code committed Aug 4, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/datatables/activerecord_methods.rb
View
4 lib/datatables/activerecord_methods.rb
@@ -40,8 +40,8 @@ def datatable( params )
# Paging
if params['iDisplayStart'] and params['iDisplayLength'] != '-1'
# sql_opts[:limit] = "#{params['iDisplayStart']},#{params['iDisplayLength']}"
- sql_opts[:limit] = "#{params['iDisplayLength']}"
- sql_opts[:offset] = "#{params['iDisplayStart']}"
+ sql_opts[:limit] = "#{params['iDisplayLength']}".to_i
+ sql_opts[:offset] = "#{params['iDisplayStart']}".to_i
end
# Ordering

0 comments on commit 2015141

Please sign in to comment.
Something went wrong with that request. Please try again.