Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before / after destroy #353

Open
endpointemail opened this issue Dec 9, 2024 · 1 comment
Open

Before / after destroy #353

endpointemail opened this issue Dec 9, 2024 · 1 comment

Comments

@endpointemail
Copy link

Hello,

I'm interested in using the before destroy and after destroy hooks on issues.
I've tried addig my custom script, but it won't be called.

Long story short: I want to call an endpoint on a different application when an issue gets deleted.
My example code looks something like this:

require 'uri'
require 'net/http'
require 'json'
data = { deleted_id: @issue.id }
Net::HTTP.post(URI.parse('...'), data.to_json)

Would someone please provide a working example for the before and after destroy hooks?

@picman
Copy link
Collaborator

picman commented Dec 19, 2024

Add a log message at the beginning of your before and after destroy script and then check your log/production.log file.
eg.

Rails.logger.info '>>> My before destroy script'

and then

tail -f log/production.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants