Module: DataMapper::Transaction::Model
- Defined in:
- lib/dm-transactions.rb
Overview
module Repository
Class Method Summary collapse
- .included(mod) ⇒ Object private
Instance Method Summary collapse
-
#transaction ⇒ Adapters::Transaction a new Adapters::Transaction with all Repositories of the class of this Resource added.
Produce a new Transaction for this Resource class.
Class Method Details
.included(mod) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
360 361 362 |
# File 'lib/dm-transactions.rb', line 360 def self.included(mod) mod.descendants.each { |model| model.extend self } end |
Instance Method Details
#transaction ⇒ Adapters::Transaction a new Adapters::Transaction with all Repositories of the class of this Resource added.
Produce a new Transaction for this Resource class
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 |