Has anyone implemented an after_commit
hook in Rails ? I am not looking for model based after commits on update/create/etc, I want to be able to dynamically define a block that will be executed only if the current (top-most) transaction passes:
def remove_file
current_transaction.after_commit do
FileUtils.rm(file_path)
end
end
Any idea if this has already been implemented, if it's going to be in rails 3.0 ?