Skip to content

Commit 9e51fd8

Browse files
committed
Improve method name
Code review identified two method names that were likely to be misleading in the future. This updates the newly introduced method to be less similar to the existing method.
1 parent 630f40b commit 9e51fd8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/models/normalize_primo_common.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@ def sanitize_authors(authors)
5252
authors.map { |author| author.strip.gsub(/\$\$Q.*$/, '') }
5353
end
5454

55+
# author_link constructs a link to Primo as an exact creator search
5556
def author_link(author)
5657
[ENV.fetch('MIT_PRIMO_URL', nil), '/discovery/search?query=creator,exact,',
57-
clean_author(author), '&tab=', ENV.fetch('PRIMO_MAIN_VIEW_TAB', nil), '&search_scope=all&vid=',
58+
encode_author(author), '&tab=', ENV.fetch('PRIMO_MAIN_VIEW_TAB', nil), '&search_scope=all&vid=',
5859
ENV.fetch('PRIMO_VID', nil)].join
5960
end
6061

61-
def clean_author(author)
62+
# encode_author ensures author components are URI encoded
63+
def encode_author(author)
6264
URI.encode_uri_component(author)
6365
end
6466

0 commit comments

Comments
 (0)