Skip to content

Commit

Permalink
🧹 Fix issue regarding Valkyrie::Identifier
Browse files Browse the repository at this point in the history
The encountered error was:

```
NoMethodError:
  undefined method `split' for #<Valkyrie::ID:0x0000ffffa5f04bc8
  @id="admin_set/default">
```
  • Loading branch information
jeremyf committed Dec 19, 2023
1 parent 9e098a8 commit 6bac28b
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 6bac28b

Please sign in to comment.