Skip to content

Commit 99a819e

Browse files
committed
Simplify identifier normalizer
Use to_s.strip instead of type-checking guard clause.
1 parent 1fa9114 commit 99a819e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/models/projects/identifier.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ module Projects::Identifier
3939
extend FriendlyId
4040

4141
normalizes :identifier, with: ->(value) {
42-
next value unless value.is_a?(String)
43-
44-
stripped = value.strip
42+
stripped = value.to_s.strip
4543
Setting::WorkPackageIdentifier.alphanumeric? ? stripped.upcase : stripped.downcase
4644
}
4745

0 commit comments

Comments
 (0)