Files
nairobi/app/controllers/stats_controller.rb
2015-08-17 22:30:24 +02:00

15 lines
319 B
Ruby

class StatsController < ApplicationController
skip_authorization_check
before_action :verify_administrator
def show
@event_types = Ahoy::Event.select(:name).uniq.pluck(:name)
end
private
def verify_administrator
raise CanCan::AccessDenied unless current_user.try(:administrator?)
end
end