diff options
author | Go MAEDA <maeda@farend.jp> | 2020-02-03 15:12:21 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-02-03 15:12:21 +0000 |
commit | 01f523f1658bdac92cfd2d1bfeb6999db2f23b46 (patch) | |
tree | 39756acff3e4b90c52afb3626cbf558b14740640 /app/models/user.rb | |
parent | e9d5b0b8dc7f22a31b788ec99f585e46818ba7fe (diff) | |
download | redmine-01f523f1658bdac92cfd2d1bfeb6999db2f23b46.tar.gz redmine-01f523f1658bdac92cfd2d1bfeb6999db2f23b46.zip |
Rails 6: Fix deprecation warning "Class level methods will no longer inherit scoping" (#32911).
Patch by Pavel Rosický.
git-svn-id: http://svn.redmine.org/redmine/trunk@19490 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 a837697a4..76f479bcd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -634,7 +634,7 @@ class User < Principal Project.unscoped do return @project_ids_by_role if @project_ids_by_role - group_class = anonymous? ? GroupAnonymous : GroupNonMember + group_class = anonymous? ? GroupAnonymous.unscoped : GroupNonMember.unscoped group_id = group_class.pluck(:id).first members = Member.joins(:project, :member_roles). @@ -970,7 +970,7 @@ class AnonymousUser < User def validate_anonymous_uniqueness # There should be only one AnonymousUser in the database - errors.add :base, 'An anonymous user already exists.' if AnonymousUser.exists? + errors.add :base, 'An anonymous user already exists.' if AnonymousUser.unscoped.exists? end def available_custom_fields |