Sha256: 9b319dc6a82d30c4caa6794da5dbdc9599e6b1bc159ce1aa9c8abb2ab462a971

Contents?: true

Size: 434 Bytes

Versions: 6

Compression:

Stored size: 434 Bytes

Contents

# -*- coding: utf-8 -*-
require 'tengine_core'
require 'mongoid'
require 'mongoid/version'
require 'mongoid/cursor'

if Mongoid::VERSION <= "3.0.0"
  class Mongoid::Cursor
    # https://github.com/mongoid/mongoid/pull/1609
    def each
      loop do
        retry_on_connection_failure do
          return unless document = cursor.next
          yield Mongoid::Factory.from_db(klass, document)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tengine_core-0.5.34 lib/tengine/core/mongoid_fix.rb
tengine_core-0.5.33 lib/tengine/core/mongoid_fix.rb
tengine_core-0.5.32 lib/tengine/core/mongoid_fix.rb
tengine_core-0.5.31 lib/tengine/core/mongoid_fix.rb
tengine_core-0.5.30 lib/tengine/core/mongoid_fix.rb
tengine_core-0.5.28 lib/tengine/core/mongoid_fix.rb