Workflow info and update

This commit is contained in:
2026-03-29 14:23:26 +03:00
parent 83b296dbe7
commit 32a7b07f2d
8 changed files with 97 additions and 4 deletions
@@ -0,0 +1,27 @@
# 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