mirror of
https://github.com/redmine/redmine.git
synced 2026-01-26 09:20:01 +01:00
Fix RuboCop offense Style/ClassEqualityComparison (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22978 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -758,13 +758,6 @@ Style/CaseLikeIf:
|
||||
Style/ClassAndModuleChildren:
|
||||
Enabled: false
|
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
||||
# AllowedMethods: ==, equal?, eql?
|
||||
Style/ClassEqualityComparison:
|
||||
Exclude:
|
||||
- 'app/models/principal.rb'
|
||||
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/ClassMethods:
|
||||
Exclude:
|
||||
|
||||
@@ -159,7 +159,7 @@ class Principal < ApplicationRecord
|
||||
return -1 if principal.nil?
|
||||
return nil unless principal.is_a?(Principal)
|
||||
|
||||
if self.class.name == principal.class.name
|
||||
if self.instance_of?(principal.class)
|
||||
self.to_s.casecmp(principal.to_s)
|
||||
else
|
||||
# groups after users
|
||||
|
||||
Reference in New Issue
Block a user