Module: Mongoid::Simplify::Connection
- Included in:
- Mongoid
- Defined in:
- lib/mongoid-simplify/connection.rb
Instance Method Summary collapse
-
#use(*args) ⇒ Object
In mongoid >= 3 the methods for connecting changed into something to complex and to complicated.
Instance Method Details
#use(*args) ⇒ Object
In mongoid >= 3 the methods for connecting changed into something to complex and to complicated. So I reimplemented this way of connecting with an plain URI.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/mongoid-simplify/connection.rb', line 10 def use(*args) args.flatten.each do |arg| if arg.kind_of? String use_session(:default, arg) elsif arg.kind_of? Hash arg.each do |name, uri| use_session(name.to_sym, uri) end end end end |