]> source.dussan.org Git - redmine.git/commitdiff
rubocop: fix Lint/IneffectiveAccessModifier in app/models/auth_source_ldap.rb (#32470)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 16 Nov 2019 13:10:51 +0000 (13:10 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 16 Nov 2019 13:10:51 +0000 (13:10 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19085 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
app/models/auth_source_ldap.rb

index d4738691e443f42b948b673aa51cc3731cc54ebd..e91e986efd0ca12838fbc85a7c5da38dd4f71cba 100644 (file)
@@ -390,10 +390,6 @@ Lint/HandleExceptions:
     - 'lib/redmine/scm/adapters/cvs_adapter.rb'
     - 'lib/redmine/scm/adapters/subversion_adapter.rb'
 
-Lint/IneffectiveAccessModifier:
-  Exclude:
-    - 'app/models/auth_source_ldap.rb'
-
 Lint/InterpolationCheck:
   Exclude:
     - 'app/models/user.rb'
index 3c55bff75d5777216b4a6ad1d86a99ce189e6e3d..aba76a6fc39491693bef5ab941d44c848f6c6487 100644 (file)
@@ -244,10 +244,13 @@ class AuthSourceLdap < AuthSource
     attrs
   end
 
-  def self.get_attr(entry, attr_name)
-    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')
+  # Singleton class method is public
+  class << self
+    def get_attr(entry, attr_name)
+      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