Module: FriendlyId::Helpers

Included in:
NonSluggableClassMethods, SluggableClassMethods
Defined in:
lib/friendly_id/helpers.rb

Instance Method Summary collapse

Instance Method Details

#expected_size(ids_and_names, options) ⇒ Object

Calculate expected result size for find_some_with_friendly (taken from active_record/base.rb)



6
7
8
9
10
# File 'lib/friendly_id/helpers.rb', line 6

def expected_size(ids_and_names, options) #:nodoc:#
  size = options[:offset] ? ids_and_names.size - options[:offset] : ids_and_names.size
  size = options[:limit] if options[:limit] && size > options[:limit]
  size
end