|
|
|
@ -54,12 +54,18 @@ class Projects::ArchiveController < ApplicationController |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def change_status(status) |
|
|
|
|
"Projects::#{status.to_s.camelcase}Service" |
|
|
|
|
.constantize |
|
|
|
|
service_class(status) |
|
|
|
|
.new(user: current_user, model: @project) |
|
|
|
|
.call |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def service_class(status) |
|
|
|
|
case status |
|
|
|
|
when :archive then Projects::ArchiveService |
|
|
|
|
when :unarchive then Projects::UnarchiveService |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def project_path_with_status |
|
|
|
|
acceptable_params = params.permit(:status).to_h.compact.select { |_, v| v.present? } |
|
|
|
|
|
|
|
|
|