-
-
Notifications
You must be signed in to change notification settings - Fork 47
ForeignKeyCascadeChecker
Imagine, you have an association with :dependent
option. It means that every time you the record is destroyed, the application expects associated data to be also affected depending on the option.
Unfortunately, as such a dependency call is based on the callbacks, it could be simply skipped. Meaning, our expectations wouldn't be met. Gladly, some of the options can be easily fixed by introducing corresponding cascade constraints on foreign keys on the database level.
Currently, supported options are:
delete
delete_all
nullify
restrict_with_exception
restrict_with_error
There is nothing to be done with destroy
or destroy_async
options because database deletion can't invoke application callbacks.
In case callbacks are not important, we highly recommend using delete
/delete_all
options instead.
If the project helps you or your organization, I would be very grateful if you contribute or donate. Your support is an incredible motivation and the biggest reward for my hard work.
- Home
- Installation
- How to run?
- Configuration
- Auto correction
- Integrations
- Checkers
- ColumnPresenceChecker
- LengthConstraintChecker
- NullConstraintChecker
- UniqueIndexChecker
- ForeignKeyChecker
- MissingUniqueIndexChecker
- MissingIndexChecker
- PrimaryKeyTypeChecker
- ForeignKeyTypeChecker
- RedundantIndexChecker
- RedundantUniqueIndexChecker
- EnumTypeChecker
- ForeignKeyCascadeChecker
- EnumValueChecker
- CaseSensitiveUniqueValidationChecker
- ThreeStateBooleanChecker
- MissingAssociationClassChecker
- MissingTableChecker
- ImplicitOrderingChecker
- FAQ
- Development