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_destroy callback not available #148

Open
masciugo opened this issue Oct 23, 2023 · 1 comment
Open

before_destroy callback not available #148

masciugo opened this issue Oct 23, 2023 · 1 comment

Comments

@masciugo
Copy link

I would need to run some action before destroying a remote record. Why the before_destroy callback is not available?

After looking into the code I had to override/integrate spyke behaviour in my model:

  define_model_callbacks :destroy, only: :before
  def destroy
    run_callbacks :destroy do
      super
    end
  end

which actually works but I wonder why destroy callback was excluded

thank you

@balvig
Copy link
Owner

balvig commented Nov 15, 2023

@masciugo good question!

I'm actually not sure I can think of a good reason to exclude destroy 😅.
Most likely we simply didn't need it at the time? 🤔

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

No branches or pull requests

2 participants