Skip to content

Commit

Permalink
Merge pull request #2076 from samvera/fixing-valkyrie-identifier-not-…
Browse files Browse the repository at this point in the history
…being-a-string

🧹 Fix issue regarding Valkyrie::Identifier
  • Loading branch information
jeremyf authored Dec 19, 2023
2 parents d122f12 + 6bac28b commit c786fb8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/initializers/hyrax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@
# See Samvera Slack thread https://samvera.slack.com/archives/C0F9JQJDQ/p1596718417351200?thread_ts=1596717896.350700&cid=C0F9JQJDQ
uri.sub(/\Ahttp:/, 'https:')
end

##
# A Valkyrie::Identifier is not a string but can be cast to a string. What we have here is in
# essence a "super" method.
original_translator = config.translate_id_to_uri
config.translate_id_to_uri = ->(id) { original_translator.call(id.to_s) }
end
# rubocop:enable Metrics/BlockLength

Expand Down

0 comments on commit c786fb8

Please sign in to comment.