Skip to content

Commit c9d040a

Browse files
committed
Merge pull request jbox-web#31 from mitchej123/fix-count-on-rails-4-1
Fix count method to work with select statement for Rails 4.1
2 parents 0440297 + 25aac8f commit c9d040a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ajax-datatables-rails/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def get_raw_records
3636
def as_json(options = {})
3737
{
3838
:draw => params[:draw].to_i,
39-
:recordsTotal => get_raw_records.count,
40-
:recordsFiltered => filter_records(get_raw_records).count,
39+
:recordsTotal => get_raw_records.count(:all),
40+
:recordsFiltered => filter_records(get_raw_records).count(:all),
4141
:data => data
4242
}
4343
end

0 commit comments

Comments
 (0)