Made projects' status not null

This commit is contained in:
2025-10-25 16:19:15 +03:00
parent ff8d520273
commit b08468568b
4 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
class Project < ApplicationRecord
enum :status, %w[preparing ready archived].index_by(&:itself), default: :preparing
validates :name, :code, presence: true
validates :name, :code, :status, presence: true
validates :code, exclusion: { in: %w[new] }, uniqueness: true, format: { with: /\A[a-z]{2,}\z/ }
has_many :tasks, dependent: :restrict_with_exception