Class: Yrpc::Interceptors::ActiveRecord::ResetConnection
- Inherits:
-
Object
- Object
- Yrpc::Interceptors::ActiveRecord::ResetConnection
- Defined in:
- lib/yrpc/interceptors/active_record.rb
Instance Method Summary collapse
Instance Method Details
#invoke ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/yrpc/interceptors/active_record.rb', line 6 def invoke if enabled? && !::ActiveRecord::Base.connection.active? ::ActiveRecord::Base.establish_connection end yield ensure ::ActiveRecord::Base.clear_active_connections! if enabled? end |