diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-20 08:59:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-20 08:59:58 +0000 |
commit | 61db44c211cd032a13ae21ed712150c4ff67a418 (patch) | |
tree | 767083c079a8daebed7db9a7d9868692a6b32a91 /app/models/user.rb | |
parent | 98787ce42cd9b33c002afe6639eb1b9e0d016da7 (diff) | |
download | redmine-61db44c211cd032a13ae21ed712150c4ff67a418.tar.gz redmine-61db44c211cd032a13ae21ed712150c4ff67a418.zip |
Merged r16049 (#24156).
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@16094 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 65fb8abf9..b74180be0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -735,9 +735,9 @@ class User < Principal # Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only # one anonymous user per database. def self.anonymous - anonymous_user = AnonymousUser.first + anonymous_user = AnonymousUser.unscoped.first if anonymous_user.nil? - anonymous_user = AnonymousUser.create(:lastname => 'Anonymous', :firstname => '', :login => '', :status => 0) + anonymous_user = AnonymousUser.unscoped.create(:lastname => 'Anonymous', :firstname => '', :login => '', :status => 0) raise 'Unable to create the anonymous user.' if anonymous_user.new_record? end anonymous_user |