# File lib/seed_dump/dump_methods/enumeration.rb, line 4
      def active_record_enumeration(records, io, options)
        # If the records don't already have an order,
        # order them by primary key ascending.
        if !records.respond_to?(:arel) || records.arel.orders.blank?
          records.order("#{records.quoted_table_name}.#{records.quoted_primary_key} ASC")
        end

        num_of_batches, batch_size, last_batch_size = batch_params_from(records, options)

        # Loop through each batch
        (1..num_of_batches).each do |batch_number|

          record_strings = []

          last_batch = (batch_number == num_of_batches)

          cur_batch_size = if last_batch
                             last_batch_size
                           else
                             batch_size
                           end

          # Loop through the records of the current batch
          records.offset((batch_number - 1) * batch_size).limit(cur_batch_size).each do |record|
            record_strings << dump_record(record, options)
          end

          yield record_strings, last_batch
        end
      end