-
-
Notifications
You must be signed in to change notification settings - Fork 47
EnumValueChecker
Evgeniy Demin edited this page Dec 3, 2022
·
1 revision
The checker ensures that the database enum values and ActiveRecord's enum values/inclusion validations are aligned.
For example, let's assume we have the following User
model.
class User < ActiveRecord::Base
enum :status, {value: 'value', unknown_value: 'unknown_value'}
# or
validates :status, inclusion: {in: %w[value unknown_value]}
end
and the database schema:
create_enum :status_type, %w[value value2]
create_table :users do |t|
# ...
t.enum :status, enum_type: :status_type
# ...
end
Then, the library will catch that there is an inconsistent value.
Note: Currently, only PostgreSQL
is supported.
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