Make (Un)ArchiveService usage discoverable by IDEs

pull/11853/head
Christophe Bliard 2 years ago
parent 3167f462fe
commit 8bd9531fd1
No known key found for this signature in database
GPG Key ID: 2BC07603210C3FA4
  1. 10
      app/controllers/projects/archive_controller.rb

@ -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? }

Loading…
Cancel
Save