lib/mongoid/shell/properties/password.rb in mongoid-shell-0.4.3 vs lib/mongoid/shell/properties/password.rb in mongoid-shell-0.4.4

- old
+ new

@@ -14,19 +14,19 @@ end elsif ::Mongoid::Compatibility::Version.mongoid4? def password @password || begin node = session.cluster.nodes.first - fail Mongoid::Shell::Errors::SessionNotConnectedError unless node + raise Mongoid::Shell::Errors::SessionNotConnectedError unless node return nil if !node.credentials.key?(db) || node.credentials[db].empty? node.credentials[db][1] end end else def password @password || begin server = session.cluster.servers.first - fail Mongoid::Shell::Errors::SessionNotConnectedError unless server + raise Mongoid::Shell::Errors::SessionNotConnectedError unless server server.context.with_connection do |connection| connection.options[:password] end end end