Module: ActionControllerExtensions

Defined in:
lib/wheels/action_controller_extensions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.authorizedObject



2
3
4
5
6
7
8
9
# File 'lib/wheels/action_controller_extensions.rb', line 2

def self.authorized
  class_eval do
    def resource
      authorize_this
      super
    end
  end
end

Instance Method Details

#authorize_thisObject



11
12
13
14
# File 'lib/wheels/action_controller_extensions.rb', line 11

def authorize_this
  authorize! resource, params[:action] unless @authorized
  @authorized = true
end