rosa-build/app/jobs/base_active_record_job.rb

10 lines
260 B
Ruby
Raw Permalink Normal View History

2016-05-28 19:21:02 +01:00
class BaseActiveRecordJob
def perform(*args)
ActiveRecord::Base.connection_pool.with_connection do
perform_with_ar_connection(*args)
end
ensure
ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.connection.close
end
end