Skip to content

Commit c6ef85c

Browse files
committed
Add presence validation to AttribValue position
The position column is required in the database, but the model was missing the validation. This commit adds the validation to the model so the constraint is in sync.
1 parent 0cfa17c commit c6ef85c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/api/.database_consistency.todo.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ AttribValue:
6666
id:
6767
PrimaryKeyTypeChecker:
6868
enabled: false
69-
position:
70-
NullConstraintChecker:
71-
enabled: false
7269
value:
7370
LengthConstraintChecker:
7471
enabled: false

src/api/app/models/attrib_value.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ class AttribValue < ApplicationRecord
22
acts_as_list scope: :attrib
33
belongs_to :attrib, optional: true
44

5+
validates :position, presence: true
6+
57
after_initialize :set_default_value
68
before_validation :universal_newlines
79

0 commit comments

Comments
 (0)