Sha256: c66bf8c2dfc9042c3ae5749d86ff3fc477625ed16cf293486521e0d4347c5ce6

Contents?: true

Size: 636 Bytes

Versions: 5

Compression:

Stored size: 636 Bytes

Contents

module DoorkeeperMongodb
  module Compatible
    extend ActiveSupport::Concern

    module ClassMethods
      def transaction(_ = {}, &_block)
        yield
      end

      def table_exists?(*)
        true # Doorkeeper deprecated this
      end

      # Mongoid::Contextual::Mongo#last no longer guarantee order
      # http://www.rubydoc.info/github/mongoid/mongoid/Mongoid%2FContextual%2FMongo:last
      def last
        asc(:id).last
      end
    end

    def transaction(options = {}, &block)
      self.class.transaction(options, &block)
    end

    def lock!(_ = true)
      reload if persisted?
      self
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
doorkeeper-mongodb-5.0.0 lib/doorkeeper-mongodb/compatible.rb
doorkeeper-mongodb-4.2.0 lib/doorkeeper-mongodb/compatible.rb
doorkeeper-mongodb-4.1.0 lib/doorkeeper-mongodb/compatible.rb
doorkeeper-mongodb-4.0.1 lib/doorkeeper-mongodb/compatible.rb
doorkeeper-mongodb-4.0.0 lib/doorkeeper-mongodb/compatible.rb