Sha256: 154ccf03a4a3cdb89c1d44b73b2864679f415122cb82f804d4010aef0e0fd5c8

Contents?: true

Size: 290 Bytes

Versions: 4

Compression:

Stored size: 290 Bytes

Contents

class ApplicationController < ActionController::Base

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wheels-0.0.6 app/controllers/application_controller.rb
wheels-0.0.5 app/controllers/application_controller.rb
wheels-0.0.4 app/controllers/application_controller.rb
wheels-0.0.3 app/controllers/application_controller.rb