~singpolyma/sgx-jmp

45d76a6bd55686bad74ff8de90e87d4414625c3d — Stephen Paul Weber 1 year, 5 months ago d3a8cab
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