Codeminer42/cm42-central

View on GitHub
app/controllers/iterations_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class IterationsController < ApplicationController
  def show
    authorize project
    iteration =
      IterationOperations::Read.call(start_date: params.require(:start_date).to_date,
                                     end_date: params.require(:end_date).to_date,
                                     project: project).success

    render json: iteration
  end

  private

  def project
    policy_scope(Project).friendly.find(params[:id])
  end
end