Workflow model
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
class Task < ApplicationRecord
|
||||
belongs_to :project
|
||||
belongs_to :status, class_name: 'TaskStatus'
|
||||
belongs_to :workflow
|
||||
|
||||
validates :number, :title, presence: true
|
||||
validates :number, numericality: { greater_than: 0 }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
class TaskStatus < ApplicationRecord
|
||||
belongs_to :project
|
||||
belongs_to :workflow
|
||||
|
||||
enum :category, { backlog: 100, analysis: 1000, development: 20_000, fulfillment: 60_000 }
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Workflow < ApplicationRecord
|
||||
belongs_to :project
|
||||
|
||||
has_many :tasks, dependent: :restrict_with_exception
|
||||
has_mnay :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
|
||||
end
|
||||
Reference in New Issue
Block a user