Sha256: d7b0ed1b328d68863c1c6ed39d6094ea72bb7c683388f9fde1e0c7f6b4768359
Contents?: true
Size: 705 Bytes
Versions: 1
Compression:
Stored size: 705 Bytes
Contents
module Mongoid module Shell module Properties module Primary attr_accessor :primary # primary database host def primary @primary || begin raise Mongoid::Shell::Errors::SessionNotConnectedError unless session.cluster.nodes.any? node = session.cluster.nodes.find(&:primary?) raise Mongoid::Shell::Errors::MissingPrimaryNodeError unless node if Mongoid::Shell.mongoid3? node.address == "localhost:27017" ? nil : node.address else node.address.original == "localhost:27017" ? nil : node.address.original end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mongoid-shell-0.3.0 | lib/mongoid/shell/properties/primary.rb |