--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Rewinds the transaction. If <tt>name</tt> is specified, then the intervening transactions will be aborted and the named transaction will be rewound. Otherwise, only the current transaction is rewound.
- !ruby/struct:SM::Flow::P 
  body: "After each level of transaction is rewound, if the callback method #_post_transaction_rewind is defined, it will be called. It is intended to allow a complex self-referential graph to fix itself. The simplest way to explain this is with an example."
- !ruby/struct:SM::Flow::VERB 
  body: "  class Child\n    attr_accessor :parent\n  end\n\n  class Parent\n    include Transaction::Simple\n\n    attr_reader :children\n    def initialize\n      @children = []\n    end\n\n    def &lt;&lt; child\n      child.parent = self\n      @children &lt;&lt; child\n    end\n\n    def valid?\n      @children.all? { |child| child.parent == self }\n    end\n  end\n\n  parent = Parent.new\n  parent &lt;&lt; Child.new\n  parent.start_transaction\n  parent &lt;&lt; Child.new\n  parent.abort_transaction\n  puts parent.valid? # =&gt; false\n"
- !ruby/struct:SM::Flow::P 
  body: "This problem can be fixed by modifying the Parent class to include the #_post_transaction_rewind callback."
- !ruby/struct:SM::Flow::VERB 
  body: "  class Parent\n    # Reconnect the restored children to me, instead of to the bogus me\n    # that was restored to them by Marshal::load.\n    def _post_transaction_rewind\n      @children.each { |child| child.parent = self }\n    end\n  end\n\n  parent = Parent.new\n  parent &lt;&lt; Child.new\n  parent.start_transaction\n  parent &lt;&lt; Child.new\n  parent.abort_transaction\n  puts parent.valid? # =&gt; true\n"
full_name: Transaction::Simple#rewind_transaction
is_singleton: false
name: rewind_transaction
params: (name = nil)
visibility: public
