Has anyone implemented an after_commit hook in Rails? I'm not looking for a model based on commits on update / create / etc, I want to be able to dynamically determine the block that will be executed only if the current (topmost) transaction passes:
def remove_file current_transaction.after_commit do FileUtils.rm(file_path) end end
Any idea if this is already implemented if it will be in rails 3.0?
ruby-on-rails transactions
gaspard
source share