module ActiveScaffold::Bridges::Cancan::ModelUserAccess::Model::ClassMethods

Public Instance Methods

current_ability() click to toggle source

Class-level access to the current ability

# File lib/active_scaffold/bridges/cancan/cancan_bridge.rb, line 90
def current_ability
  ::ActiveRecord::Base.current_ability_proc.call if ::ActiveRecord::Base.current_ability_proc
end
current_ability_proc() click to toggle source

The proc to call that retrieves the #current_ability from the ApplicationController.

# File lib/active_scaffold/bridges/cancan/cancan_bridge.rb, line 81
def current_ability_proc
  Thread.current[:current_ability_proc]
end
current_ability_proc=(value) click to toggle source
# File lib/active_scaffold/bridges/cancan/cancan_bridge.rb, line 85
def current_ability_proc=(value)
  Thread.current[:current_ability_proc] = value
end