linguisticexplorer/Linguistic-Explorer

View on GitHub
app/controllers/application_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ApplicationController < ActionController::Base
  protect_from_forgery
  helper_method :current_group

  rescue_from CanCan::AccessDenied do |exception|
    redirect_to root_url, :alert => exception.message
  end
  
  def current_group
    Group.first # changed to default to first group
  end

  def collection_authorize!(action, collection, *args)
    collection.each do |item|
      authorize! action, item, *args
    end
  end
end