lib/dirty_pipeline.rb in dirty_pipeline-0.8.1 vs lib/dirty_pipeline.rb in dirty_pipeline-0.8.2
- old
+ new
@@ -30,9 +30,17 @@
# This method should yield raw PG connection
def self.with_postgres
fail NotImplementedError
end
+ def self.with_postgres_transaction
+ with_postgres do |conn|
+ conn.transaction do |transaction_conn|
+ yield transaction_conn
+ end
+ end
+ end
+
# def self.with_postgres
# yield(ActiveRecord::Base.connection.raw_connection)
# ensure
# ActiveRecord::Base.clear_active_connections!
# end