Sha256: c098eb5c67f266f5f7d11a30f373c0428594dce0b99b5a8a7686277be43a82a9
Contents?: true
Size: 867 Bytes
Versions: 37
Compression:
Stored size: 867 Bytes
Contents
require 'rom/commands/result' module ROM module SQL module Commands # Adds transaction interface to commands # # @api private module Transaction ROM::SQL::Rollback = Class.new(Sequel::Rollback) # Start a transaction # # @param [Hash] options The options hash supported by Sequel # # @return [ROM::Commands::Result::Success,ROM::Commands::Result::Failure] # # @api public def transaction(options = {}, &block) result = relation.dataset.db.transaction(options, &block) if result ROM::Commands::Result::Success.new(result) else ROM::Commands::Result::Failure.new(result) end rescue ROM::CommandError => e ROM::Commands::Result::Failure.new(e) end end end end end
Version data entries
37 entries across 37 versions & 1 rubygems