Patch #16685 ยป 0001-Introduce-request_store-to-ensure-that-the-current-u.patch
| Gemfile | ||
|---|---|---|
|
gem "coderay", "~> 1.1.0"
|
||
|
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
|
||
|
gem "builder", "3.0.0"
|
||
|
gem 'request_store'
|
||
|
gem "mime-types"
|
||
|
# Optional gem for LDAP authentication
|
||
| app/models/user.rb | ||
|---|---|---|
|
end
|
||
|
def self.current=(user)
|
||
|
Thread.current[:current_user] = user
|
||
|
RequestStore.store[:current_user] = user
|
||
|
end
|
||
|
def self.current
|
||
|
Thread.current[:current_user] ||= User.anonymous
|
||
|
RequestStore.store[:current_user] ||= User.anonymous
|
||
|
end
|
||
|
# Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only
|
||