Sha256: 4115484e7b106b9119b4f8f709e7fdd65d87a68489009ddca844b3c204295422

Contents?: true

Size: 447 Bytes

Versions: 7

Compression:

Stored size: 447 Bytes

Contents

module Mongoid
  module Shell
    module Properties
      module Database
        attr_accessor :db

        # current database name
        if ::Mongoid::Compatibility::Version.mongoid3? || ::Mongoid::Compatibility::Version.mongoid4?
          def db
            @db || session.send(:current_database).name
          end
        else
          def db
            @db || session.database.name
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mongoid-shell-0.4.6 lib/mongoid/shell/properties/database.rb
mongoid-shell-0.4.5 lib/mongoid/shell/properties/database.rb
mongoid-shell-0.4.4 lib/mongoid/shell/properties/database.rb
mongoid-shell-0.4.3 lib/mongoid/shell/properties/database.rb
mongoid-shell-0.4.2 lib/mongoid/shell/properties/database.rb
mongoid-shell-0.4.1 lib/mongoid/shell/properties/database.rb
mongoid-shell-0.4.0 lib/mongoid/shell/properties/database.rb