hugopl/reviewit

View on GitHub
app/controllers/mr_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class MrController < ApplicationController
  def show
    project = current_user.projects.joins(:merge_requests).where('merge_requests.id = ?', params[:id]).first
    raise ActiveRecord::RecordNotFound, 'Merge request not found.' if project.nil?

    redirect_to("/projects/#{project.id}/merge_requests/#{params[:id]}")
  end
end