2014-08-07 09:19:58 +03:00
|
|
|
module ActiveRecord
|
|
|
|
|
class Base
|
|
|
|
|
mattr_accessor :shared_connection
|
|
|
|
|
@@shared_connection = nil
|
2014-07-04 22:35:47 +02:00
|
|
|
|
2014-08-07 09:19:58 +03:00
|
|
|
def self.connection
|
|
|
|
|
@@shared_connection || retrieve_connection
|
|
|
|
|
end
|
2014-07-04 22:35:47 +02:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
|