Changed workflows rendering again

This commit is contained in:
2026-03-24 00:28:14 +02:00
parent 1c1d11cbe6
commit 83b296dbe7
13 changed files with 67 additions and 59 deletions
-9
View File
@@ -8,15 +8,6 @@ class TaskStatus < ApplicationRecord
validates :name, presence: true, uniqueness: { scope: :workflow }
validates :category, presence: true
validate :associations_should_have_same_project
scope :default_order, -> { order(:category, :name) }
private
def associations_should_have_same_project
return if workflow.project == project
errors.add(:workflow, "Doesn't belong in the same project")
end
end
+1 -1
View File
@@ -7,5 +7,5 @@ class Workflow < ApplicationRecord
has_many :task_statuses, dependent: :restrict_with_error
enum :icon, { task: 'task', warning: 'warning' }, default: 'task', scopes: false
enum :color, { blue: 'blue', gray: 'gray', yellow: 'yellow', red: 'red' }, default: 'gray', scopes: false
enum :color, { blue: 'blue', gray: 'gray', lime: 'lime', red: 'red', teal: 'teal' }, default: 'gray', scopes: false
end