attachinary
attachinary copied to clipboard
Callbacks?
I need to hook into the destroy method. Any ideas?
Hi @npearson72,
You can use alias_method (or alias_method_chain if you are using Rails) to achieve this.
For (a partial) example:
module Attachinary
module FileMixin
def destroy_hook
# your code here
destroy_file_orig
end
alias_method :destroy_file_orig, :destroy_file
alias_method :destroy_file, :destroy_hook
end
end