module ActiveScaffold::ActiveRecordPermissions::ModelUserAccess::Model::ClassMethods

Public Instance Methods

current_user() click to toggle source

Class-level access to the current user

# File lib/active_scaffold/active_record_permissions.rb, line 57
def current_user
  ActiveRecord::Base.current_user_proc.call if ActiveRecord::Base.current_user_proc
end
current_user_proc() click to toggle source

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

# File lib/active_scaffold/active_record_permissions.rb, line 48
def current_user_proc
  Thread.current[:current_user_proc]
end
current_user_proc=(proc_value) click to toggle source
# File lib/active_scaffold/active_record_permissions.rb, line 52
def current_user_proc=(proc_value)
  Thread.current[:current_user_proc] = proc_value
end