rubyforgood/casa

View on GitHub
app/controllers/learning_hours/volunteers_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class LearningHours::VolunteersController < ApplicationController
  before_action :set_volunteer, only: :show
  after_action :verify_authorized

  def show
    authorize @volunteer
    @learning_hours = LearningHour.where(user: @volunteer)
  end

  private

  def set_volunteer
    @volunteer = User.includes(:learning_hours).find(params[:id])
  end
end