Commit 714f264d authored by Michael Kozono's avatar Michael Kozono

Rename method to `to_normalized_s`

parent a6a764f7
...@@ -220,7 +220,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration ...@@ -220,7 +220,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
## ##
# Return the DN as an escaped and normalized string. # Return the DN as an escaped and normalized string.
def to_s_normalized def to_normalized_s
self.class.new(*to_a).to_s self.class.new(*to_a).to_s
end end
...@@ -270,7 +270,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration ...@@ -270,7 +270,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
ldap_identities = Identity.where("provider like 'ldap%'") ldap_identities = Identity.where("provider like 'ldap%'")
ldap_identities.find_each do |identity| ldap_identities.find_each do |identity|
begin begin
identity.extern_uid = Gitlab::LDAP::DN.new(identity.extern_uid).to_s_normalized identity.extern_uid = Gitlab::LDAP::DN.new(identity.extern_uid).to_normalized_s
unless identity.save unless identity.save
say "Unable to normalize \"#{identity.extern_uid}\". Skipping." say "Unable to normalize \"#{identity.extern_uid}\". Skipping."
end end
......
...@@ -4,7 +4,7 @@ module Gitlab ...@@ -4,7 +4,7 @@ module Gitlab
module LDAP module LDAP
class AuthHash < Gitlab::OAuth::AuthHash class AuthHash < Gitlab::OAuth::AuthHash
def uid def uid
Gitlab::LDAP::DN.new(super).to_s_normalized Gitlab::LDAP::DN.new(super).to_normalized_s
end end
private private
......
...@@ -235,7 +235,7 @@ module Gitlab ...@@ -235,7 +235,7 @@ module Gitlab
## ##
# Return the DN as an escaped and normalized string. # Return the DN as an escaped and normalized string.
def to_s_normalized def to_normalized_s
self.class.new(*to_a).to_s.downcase self.class.new(*to_a).to_s.downcase
end end
......
...@@ -72,7 +72,7 @@ module Gitlab ...@@ -72,7 +72,7 @@ module Gitlab
end end
def dn def dn
DN.new(entry.dn).to_s_normalized DN.new(entry.dn).to_normalized_s
end end
private private
......
...@@ -3,8 +3,8 @@ require 'spec_helper' ...@@ -3,8 +3,8 @@ require 'spec_helper'
describe Gitlab::LDAP::DN do describe Gitlab::LDAP::DN do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
describe '#to_s_normalized' do describe '#to_normalized_s' do
subject { described_class.new(given).to_s_normalized } subject { described_class.new(given).to_normalized_s }
# Regarding the telephoneNumber test: # Regarding the telephoneNumber test:
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment