-
-
Notifications
You must be signed in to change notification settings - Fork 54
MissingAssociationClassChecker
Evgeniy Demin edited this page Jul 9, 2023
·
1 revision
Sometimes, your associations point to an undefined model. That could be fine if you don't use those associations anymore.
However, it's always good to clean them up for the codebase or to fix them by specifying a class_name or generating a model.
Example:
class User < ApplicationRecord
has_many :something
end
If no Something model exists in your codebase, database_consistency will find it.
P.S. The check is not supported by polymorphic associations.
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
- Implementing Custom Checker
- Checkers
- ColumnPresenceChecker
- LengthConstraintChecker
- NullConstraintChecker
- UniqueIndexChecker
- ForeignKeyChecker
- MissingUniqueIndexChecker
- MissingIndexChecker
- PrimaryKeyTypeChecker
- ForeignKeyTypeChecker
- RedundantIndexChecker
- RedundantUniqueIndexChecker
- EnumTypeChecker
- ForeignKeyCascadeChecker
- EnumValueChecker
- CaseSensitiveUniqueValidationChecker
- ThreeStateBooleanChecker
- MissingAssociationClassChecker
- MissingTableChecker
- ImplicitOrderingChecker
- FAQ
- Development