Project

General

Profile

« Previous | Next » 

Revision 475cdc84

Added by Ohad Levy about 13 years ago

  • ID 475cdc847254deca6bd0d4d2cb3fd6ec8fa37939

fixes #807 - Update the User.current implementation to use a Thread-local variable

View differences:

app/models/user.rb
require 'digest/sha1'
require 'foreman/threadsession'
class User < ActiveRecord::Base
include Authorization
include Foreman::ThreadSession::UserModel
attr_protected :password_hash, :password_salt, :admin
attr_accessor :password, :password_confirmation
......
scoped_search :on => :admin, :complete_value => {:true => true, :false => false}
scoped_search :on => :last_login_on, :complete_value => :true
cattr_accessor :current
def to_label
"#{firstname} #{lastname}"
end

Also available in: Unified diff