Skip to content

Commit

Permalink
🐛 Account for Valkyrie ID in location indexer
Browse files Browse the repository at this point in the history
In #extract_id we were receiving an error because
it didn't account for a Valkyrie::ID in its case
statement. This commit adds a case for Valkyrie::ID.
  • Loading branch information
ShanaLMoore committed Apr 24, 2024
1 parent 42eccf4 commit f6a5bec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/indexers/concerns/hyrax/location_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def to_solr

def based_near_label_lookup(locations)
locations.map do |loc|
location_service.full_label(loc)
location_service.full_label(loc.to_s)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/services/hyrax/location_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def full_label(uri)

def extract_id(obj)
uri = case obj
when String
when String, Valkyrie::ID
URI(obj)
when URI
obj
Expand Down

0 comments on commit f6a5bec

Please sign in to comment.