Skip to content

Commit 03ba132

Browse files
committed
Added Mongoid check & handling.
1 parent b80ada8 commit 03ba132

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/views/layouts/application.datatables.jsonify

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ instance_variables.each do |vn|
1313
if v.class.name.start_with?("Array") and v.respond_to?('size') and (current_page_entries == 0)
1414
current_page_entries = v.size
1515
end
16+
17+
# Mongoid...
18+
if v.class.name.start_with?("Mongoid::Criteria")
19+
total_entries = v.length
20+
end
21+
1622
if v.respond_to?('total_entries')
1723
total_entries = v.total_entries
1824
current_page_entries = v.size

0 commit comments

Comments
 (0)