Class: Module
- Inherits:
-
Object
- Object
- Module
- Defined in:
- lib/magic_multi_connections/module.rb
Instance Attribute Summary collapse
-
#connection_spec ⇒ Object
Returns the value of attribute connection_spec.
Instance Method Summary collapse
- #establish_connection(connection_spec, namespace_reflections_mirror_db = true) ⇒ Object
- #parent_module ⇒ Object
Instance Attribute Details
#connection_spec ⇒ Object
Returns the value of attribute connection_spec.
2 3 4 |
# File 'lib/magic_multi_connections/module.rb', line 2 def connection_spec @connection_spec end |
Instance Method Details
#establish_connection(connection_spec, namespace_reflections_mirror_db = true) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/magic_multi_connections/module.rb', line 4 def establish_connection(connection_spec, namespace_reflections_mirror_db = true) include MagicMultiConnection::Connected instance_variable_set '@connection_spec', connection_spec instance_variable_set '@namespace_reflections_mirror_db', namespace_reflections_mirror_db update_active_records end |
#parent_module ⇒ Object
11 12 13 14 15 |
# File 'lib/magic_multi_connections/module.rb', line 11 def parent_module parent = self.name.split('::')[0..-2].join('::') parent = 'Object' if parent.blank? parent.constantize end |