1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 19:47:14 +00:00

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
This commit is contained in:
Go MAEDA 2020-02-03 15:12:21 +00:00
parent e9d5b0b8dc
commit 01f523f165
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -66,7 +66,7 @@ module Redmine
h[column] = yield(column)
h
end
self.class.where(condition_hash)
self.class.unscoped.where(condition_hash)
end
def set_default_position