Module: ActiveScaffold::ActiveRecordPermissions::ModelUserAccess::Model::ClassMethods

Defined in:
lib/active_scaffold/active_record_permissions.rb

Instance Method Summary collapse

Instance Method Details

#current_userObject

Class-level access to the current user



61
62
63
# File 'lib/active_scaffold/active_record_permissions.rb', line 61

def current_user
  ActiveRecord::Base.current_user_proc.call if ActiveRecord::Base.current_user_proc
end

#current_user_procObject

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



52
53
54
# File 'lib/active_scaffold/active_record_permissions.rb', line 52

def current_user_proc
  Thread.current[:current_user_proc]
end

#current_user_proc=(proc_value) ⇒ Object



56
57
58
# File 'lib/active_scaffold/active_record_permissions.rb', line 56

def current_user_proc=(proc_value)
  Thread.current[:current_user_proc] = proc_value
end