Module: Irie::Extensions::Count

Extended by:
ActiveSupport::Concern
Defined in:
lib/irie/extensions/count.rb

Overview

Allowing setting ‘@count` with the count of the records in the index query.

Instance Method Summary collapse

Instance Method Details

#index(options = {}, &block) ⇒ Object



12
13
14
15
16
17
# File 'lib/irie/extensions/count.rb', line 12

def index(options={}, &block)
  logger.debug("Irie::Extensions::Count.index") if ::Irie.debug?
  return super(options, &block) unless aliased_param_present?(:count)
  @count = collection.count
  return respond_to?(:autorender_count, true) ? autorender_count(options, &block) : super(options, &block)
end