Wrap the connection yielded from a transaction
1 files changed, 6 insertions(+), 0 deletions(-) M lib/postgres.rb
M lib/postgres.rb => lib/postgres.rb +6 -0
@@ 15,4 15,10 @@ class Postgres < SimpleDelegator rows.field_names_as(field_names_as)&.first || default end end + + def transaction(*args) + super(*args) do |db| + yield self.class.new(db) + end + end end