Task status selector in index

This commit is contained in:
2025-10-31 22:42:26 +02:00
parent 8bb22f8e04
commit 74c22b7b3d
11 changed files with 92 additions and 6 deletions
-2
View File
@@ -4,8 +4,6 @@ class ApplicationService
include ActiveModel::Model
include ActiveModel::Attributes
attr_reader :errors
def perform
# Override this
end
+22
View File
@@ -0,0 +1,22 @@
# frozen_string_literal: true
module Tasks
class ChangeStatus < ApplicationService
attribute :status_id, :integer
validates :status_id, presence: true
attr_reader :task
delegate :model_name, to: Task
def perform(task)
@task = task
@id = task.id
return false unless valid?
@task.status_id = status_id
save @task
end
end
end