Workflow creation

This commit is contained in:
2026-04-22 02:15:16 +03:00
parent 52f2191a25
commit fb03bb1a2d
7 changed files with 26 additions and 37 deletions
@@ -1,27 +0,0 @@
# frozen_string_literal: true
module ProjectAdmin
module Workflows
class Update < ApplicationService
attribute :id, :integer
attribute :name, :string
attribute :icon, :string
attribute :color, :string
validates :name, presence: true
validates :icon, inclusion: { in: Workflow.icons.values }
validates :color, inclusion: { in: Workflow.colors.values }
delegate :model_name, to: Workflow
def persisted? = true
def perform(workflow)
@workflow = workflow
@id = workflow.id
@workflow.assign_attributes(icon:, color:, name:)
save @workflow
end
end
end
end