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:
parent
e9d5b0b8dc
commit
01f523f165
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user