tsurupin/portfolio

View on GitHub
app/controllers/cms/api/v1/projects/acceptances_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Cms::Api::V1::Projects::AcceptancesController < Cms::ApplicationController
  def update
    project = Project::Form.find(params[:project_id])
    if project.update(accepted: !project.accepted)
      render json: { accepted: project.accepted }, status: :ok
    else
      render_error_message(project)
    end
  end
end