diff --git a/src/db/begin_transaction.cr b/src/db/begin_transaction.cr index 47eede8..58db073 100644 --- a/src/db/begin_transaction.cr +++ b/src/db/begin_transaction.cr @@ -13,7 +13,9 @@ module DB # can be called explicitly. # Returns the value of the block. def transaction(& : Transaction -> T) : T? forall T - tx = begin_transaction + # TODO: Cast to workaround crystal-lang/crystal#9483 + # begin_transaction returns a Tx where Tx < Transaction + tx = begin_transaction.as(Transaction) begin res = yield tx rescue DB::Rollback