Task status model rework

Replaced categories with colors, icons and positions
This commit is contained in:
2026-04-06 02:30:33 +03:00
parent 138f1c42a0
commit 9766430e69
20 changed files with 74 additions and 25 deletions
+3 -2
View File
@@ -4,10 +4,11 @@ class TaskStatus < ApplicationRecord
belongs_to :workflow
has_one :project, through: :workflow
enum :category, { backlog: 100, analysis: 1000, development: 20_000, fulfillment: 60_000 }
enum :icon, %w[new achived done circle_dash hammer play tool].index_by(&:itself), default: 'new', scopes: false
enum :color, %w[blue gray yellow green purple pink].index_by(&:itself), default: 'gray', scopes: false
validates :name, presence: true, uniqueness: { scope: :workflow }
validates :category, presence: true
scope :default_order, -> { order(:category, :name) }
scope :default_order, -> { order(:position, :name) }
end