Skip to content

Commit

Permalink
Update staff url to new format (#246)
Browse files Browse the repository at this point in the history
* Update staff url to new format

* actually replace and downcase url

* escaping url for special characters

---------

Co-authored-by: Ryan Laddusaw <[email protected]>
  • Loading branch information
rladdusaw and Ryan Laddusaw authored Jul 15, 2024
1 parent 1f9f995 commit 2310876
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/models/library_staff_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ def type
def description; end

def url
"https://library.princeton.edu/staff/#{document.netid}"
staff_url = "https://library.psb-prod.princeton.edu/people/#{document.first_name}-#{document.last_name}"
.gsub(' ', '-')
.downcase
URI::Parser.new.escape(staff_url)
end

def doc_keys
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/library_staff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
title: 'Trout, Nimbus',
id: 00_0000_002,
type: 'Library Staff',
url: 'https://library.princeton.edu/staff/nimbuskt',
url: 'https://library.psb-prod.princeton.edu/people/nimbus-kilgore-trout',
other_fields: {
building: 'Firestone Library',
department: 'Office of the Deputy Dean of Libraries',
Expand Down

0 comments on commit 2310876

Please sign in to comment.