Sha256: 2c6ddd5389cca9671b6dc87a74f3eba081d3d7bcf752cc3b4f3acea0786329b0

Contents?: true

Size: 415 Bytes

Versions: 15

Compression:

Stored size: 415 Bytes

Contents

# encoding: utf-8

module FriendlyId
  
  module Helpers
    # Calculate expected result size for find_some_with_friendly (taken from
    # active_record/base.rb)
    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
  end
  
end

Version data entries

15 entries across 15 versions & 7 rubygems

Version Path
nateabbott-friendly_id-2.1.4 lib/friendly_id/helpers.rb
nateabbott-friendly_id-2.1.7 lib/friendly_id/helpers.rb
nateabbott-friendly_id-2.1.8 lib/friendly_id/helpers.rb
nateabbott-nateabbott-friendly_id-2.1.5 lib/friendly_id/helpers.rb
nateabbott-nateabbott-friendly_id-2.1.6 lib/friendly_id/helpers.rb
norman-friendly_id-2.1.4 lib/friendly_id/helpers.rb
nwp-friendly_id-2.1.3 lib/friendly_id/helpers.rb
rakutenusa-friendly_id-2.0.8 lib/friendly_id/helpers.rb
rakutenusa-friendly_id-2.0.9 lib/friendly_id/helpers.rb
friendly_id-2.1.5 lib/friendly_id/helpers.rb
friendly_id-2.2.2 lib/friendly_id/helpers.rb
nateabbott-friendly-id-2.2.1 lib/friendly_id/helpers.rb
friendly_id-2.2.1 lib/friendly_id/helpers.rb
friendly_id-2.2.0 lib/friendly_id/helpers.rb
friendly_id-2.1.4 lib/friendly_id/helpers.rb