Skip to content

Commit 19e5c66

Browse files
committed
Refactor StoryRepository#normalize_url for improved readability
1 parent 80ac241 commit 19e5c66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/repositories/story_repository.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ def self.normalize_url(url, base_url)
115115
uri = URI.parse(url)
116116
base_uri = URI.parse(base_url)
117117

118-
uri.scheme ||= base_uri.scheme || 'http'
118+
unless uri.scheme
119+
uri.scheme = base_uri.scheme || 'http'
120+
end
121+
119122
uri.to_s
120123
end
121124

0 commit comments

Comments
 (0)