Skip to content

Instantly share code, notes, and snippets.

@roidrage
Created March 23, 2009 10:13
Show Gist options
  • Save roidrage/83496 to your computer and use it in GitHub Desktop.
Save roidrage/83496 to your computer and use it in GitHub Desktop.
module Capistrano
class Configuration
module Extensions
module Execution
def transaction(&blk)
super do
self.rollback_requests = [] unless transaction?
blk.call
end
end
def on_rollback(&block)
self.rollback_requests ||= [] if transaction?
super
end
def rollback!
return if rollback_requests.nil?
super
Thread.current[:rolled_back] = true
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment