Class: ConsoleKit::Connections::MongoConnectionHandler
- Inherits:
-
BaseConnectionHandler
- Object
- BaseConnectionHandler
- ConsoleKit::Connections::MongoConnectionHandler
- Extended by:
- Forwardable
- Defined in:
- lib/console_kit/connections/mongo_connection_handler.rb
Overview
Handles MongoDB connections
Instance Attribute Summary
Attributes inherited from BaseConnectionHandler
Instance Method Summary collapse
Methods inherited from BaseConnectionHandler
Constructor Details
This class inherits a constructor from ConsoleKit::Connections::BaseConnectionHandler
Instance Method Details
#available? ⇒ Boolean
23 |
# File 'lib/console_kit/connections/mongo_connection_handler.rb', line 23 def available? = defined?(Mongoid) |
#connect ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/console_kit/connections/mongo_connection_handler.rb', line 14 def connect return if tenant_mongo_db.blank? Output.print_info("Switching to MongoDB client: #{tenant_mongo_db}") Mongoid.override_client(tenant_mongo_db) rescue NoMethodError Output.print_warning('Mongoid.override_client is not defined.') end |