module ActiveAdmin::Helpers::Collection
Public Instance Methods
Source
# File lib/active_admin/helpers/collection.rb, line 16 def collection_is_empty?(c = collection) collection_size(c) == 0 end
Source
# File lib/active_admin/helpers/collection.rb, line 7 def collection_size(c = collection) return c.count if c.is_a?(Array) return c.length if c.limit_value c = c.except :select, :order c.group_values.present? ? c.count.count : c.count end
-
removes ‘select` and `order` to prevent invalid SQL
-
correctly handles the Hash returned when ‘group by` is used