Module: Canable::Enforcers

Defined in:
lib/canable.rb

Overview

Module that holds all the enforce__permission methods for use in controllers.

Class Method Summary collapse

Class Method Details

.included(controller) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/canable.rb', line 10

def self.included(controller)
  controller.class_eval do
    Canable.cans.each do |can|
      helper_method "can_#{can}?" if controller.respond_to?(:helper_method)
      hide_action   "can_#{can}?" if controller.respond_to?(:hide_action)
    end
  end
end