Sha256: 71b42a1d9c2152973c8ada43930eac3e3c35f81411373b77516107e140ab7d7d

Contents?: true

Size: 336 Bytes

Versions: 66

Compression:

Stored size: 336 Bytes

Contents

module ActionControllerExtensions
  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

ActionController::Base.send :include, ActionControllerExtensions

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
wheels-0.1.30 lib/wheels/action_controller_extensions.rb
wheels-0.1.28 lib/wheels/action_controller_extensions.rb
wheels-0.1.27 lib/wheels/action_controller_extensions.rb
wheels-0.1.25 lib/wheels/action_controller_extensions.rb
wheels-0.1.24 lib/wheels/action_controller_extensions.rb
wheels-0.1.23 lib/wheels/action_controller_extensions.rb
wheels-0.1.22 lib/wheels/action_controller_extensions.rb
wheels-0.1.21 lib/wheels/action_controller_extensions.rb
wheels-0.1.20 lib/wheels/action_controller_extensions.rb
wheels-0.1.19 lib/wheels/action_controller_extensions.rb
wheels-0.1.18 lib/wheels/action_controller_extensions.rb
wheels-0.1.17 lib/wheels/action_controller_extensions.rb
wheels-0.1.16 lib/wheels/action_controller_extensions.rb
wheels-0.1.15 lib/wheels/action_controller_extensions.rb
wheels-0.1.14 lib/wheels/action_controller_extensions.rb
wheels-0.1.13 lib/wheels/action_controller_extensions.rb
wheels-0.1.12 lib/wheels/action_controller_extensions.rb
wheels-0.1.11 lib/wheels/action_controller_extensions.rb
wheels-0.1.10 lib/wheels/action_controller_extensions.rb
wheels-0.1.9 lib/wheels/action_controller_extensions.rb