lib/mongoid/shell/properties/password.rb in mongoid-shell-0.1.0 vs lib/mongoid/shell/properties/password.rb in mongoid-shell-0.2.0
- old
+ new
@@ -1,15 +1,19 @@
module Mongoid
module Shell
module Properties
module Password
+ attr_accessor :password
+
# current password
def password
- return nil unless session.context.cluster.auth && session.context.cluster.auth.first
- session.context.cluster.auth.first[1][1]
+ @password || begin
+ return nil unless session.context.cluster.auth && session.context.cluster.auth.first
+ session.context.cluster.auth.first[1][1]
+ end
end
end
end
end
-end
\ No newline at end of file
+end