Sha256: 7529c9f4b4e821682ca411427b6a588facde0a37d1419f25713f60c79a702837
Contents?: true
Size: 572 Bytes
Versions: 42
Compression:
Stored size: 572 Bytes
Contents
module Startback module Support class TransactionManager def initialize(db, method = :transaction) @db = db @method = method end def call(runner, op, &then_block) raise ArgumentError, "A block is required" unless then_block before = (op.class.transaction_policy == :before_call) if before @db.send(@method) do then_block.call end else then_block.call end end end # class TransactionManager end # module Support end # module Startback
Version data entries
42 entries across 42 versions & 3 rubygems
Version | Path |
---|---|
startback-0.10.1 | lib/startback/support/transaction_manager.rb |
startback-0.10.0 | lib/startback/support/transaction_manager.rb |