1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

rubocop: fix Lint/IneffectiveAccessModifier in app/models/auth_source_ldap.rb (#32470)

git-svn-id: http://svn.redmine.org/redmine/trunk@19085 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2019-11-16 13:10:51 +00:00
parent 03e719b12b
commit bd00d16d0f
2 changed files with 7 additions and 8 deletions

View File

@ -390,10 +390,6 @@ Lint/HandleExceptions:
- 'lib/redmine/scm/adapters/cvs_adapter.rb' - 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/subversion_adapter.rb' - 'lib/redmine/scm/adapters/subversion_adapter.rb'
Lint/IneffectiveAccessModifier:
Exclude:
- 'app/models/auth_source_ldap.rb'
Lint/InterpolationCheck: Lint/InterpolationCheck:
Exclude: Exclude:
- 'app/models/user.rb' - 'app/models/user.rb'

View File

@ -244,10 +244,13 @@ class AuthSourceLdap < AuthSource
attrs attrs
end end
def self.get_attr(entry, attr_name) # Singleton class method is public
if !attr_name.blank? class << self
value = entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] def get_attr(entry, attr_name)
value.to_s.force_encoding('UTF-8') if !attr_name.blank?
value = entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]
value.to_s.force_encoding('UTF-8')
end
end end
end end
end end