Module: DataMapper::Transaction::Model
- Defined in:
- lib/dm-core/transaction.rb
Overview
module Repository
Class Method Summary collapse
-
.included(mod) ⇒ Object
private
TODO: document.
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.
TODO: document
461 462 463 |
# File 'lib/dm-core/transaction.rb', line 461 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
472 473 474 475 |
# File 'lib/dm-core/transaction.rb', line 472 def transaction transaction = Transaction.new(self) transaction.commit { |block_args| yield(*block_args) } end |