Method: DataMapper::Transaction::Model#transaction

Defined in:
lib/dm-transactions.rb

#transactionAdapters::Transaction a new Adapters::Transaction with all Repositories of the class of this Resource added.

Produce a new Transaction for this Resource class

Returns:

  • (Adapters::Transaction a new Adapters::Transaction with all Repositories of the class of this Resource added.)

    Adapters::Transaction a new Adapters::Transaction with all Repositories of the class of this Resource added.



371
372
373
374
# File 'lib/dm-transactions.rb', line 371

def transaction
  transaction = Transaction.new(self)
  transaction.commit { |block_args| yield(*block_args) }
end