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

Permanent_records and Rails Engines failure #109

Open
Anuta555 opened this issue Jan 23, 2020 · 0 comments
Open

Permanent_records and Rails Engines failure #109

Anuta555 opened this issue Jan 23, 2020 · 0 comments

Comments

@Anuta555
Copy link

I have a model Productable that has_many products with dependent: :destroy
I have a model Product in both the main app and in the engine.
I have other models in the engine that belong_to Product

When my productable gets destroyed, product gets destroyed too - both hard deleted.
However, product has deleted_at column.

I have a before_destroy hook on the Product model, which triggers an event in the Engine, that in turn, removes something that belongs_to the Product in the engine.

This event from the main app the Product model, for some reason, is triggered twice - and that's the error. Why is the before_destroy hook on the Product is triggered twice?

Removing the gem eliminated the error - so it definitely has something to do with how the gem works with the Rails engines.

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

1 participant