Add specs to prevent `through:` associations from being overridden
requested to merge 424536-prevent-wrong-destroy-behaviour-when-overriding-activerecord-association into master
What does this MR do and why?
The change prevents overriding of has_many through:
or has_one through:
associations to avoid data loss and other potential issues by introducing a new spec to keep a check on this.
Also adds documentation detailing the cons of overriding such associations.
Specs fail like this, when an through:
is overridden and not temporarily allowed:
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #424536 (closed)
Edited by Manoj M J