Module: TestProf::ActiveRecordSharedConnection
- Defined in:
- lib/test_prof/recipes/active_record_shared_connection.rb
Overview
Forces ActiveRecord to use the same connection between threads
Defined Under Namespace
Modules: Connection, Ext
Class Attribute Summary collapse
-
.connection ⇒ Object
readonly
Returns the value of attribute connection.
Class Method Summary collapse
Class Attribute Details
.connection ⇒ Object
Returns the value of attribute connection.
7 8 9 |
# File 'lib/test_prof/recipes/active_record_shared_connection.rb', line 7 def connection @connection end |
Class Method Details
.disable! ⇒ Object
13 14 15 |
# File 'lib/test_prof/recipes/active_record_shared_connection.rb', line 13 def disable! self.connection = nil end |
.enable! ⇒ Object
9 10 11 |
# File 'lib/test_prof/recipes/active_record_shared_connection.rb', line 9 def enable! self.connection = ActiveRecord::Base.connection end |