BathHacked/energy-sparks

View on GitHub
app/controllers/schools/private_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Schools
  class PrivateController < ApplicationController
    load_resource :school

    skip_before_action :authenticate_user!

    def show
      if @school.public? || can?(:show, @school)
        redirect_to school_path(@school)
      else
        render :show
      end
    end
  end
end