Skip to content

Commit

Permalink
Merge pull request #6112 from samvera/5573-one-step-workflow
Browse files Browse the repository at this point in the history
5573-one-step-workflow
  • Loading branch information
alishaevn authored Jul 28, 2023
2 parents cbdc319 + 92ff4f4 commit 90d49e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/hyrax/active_fedora_dummy_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ def to_partial_path
##
# @api public
def to_global_id
URI::GID.build app: GlobalID.app, model_name: model_name.name, model_id: @id
# this covers the use case of creating a non Valkyrie::Resource, while using Valkyrie
if model_name.name.constantize <= Valkyrie::Resource
URI::GID.build app: GlobalID.app, model_name: Hyrax::ValkyrieGlobalIdProxy.to_s, model_id: @id
else
URI::GID.build app: GlobalID.app, model_name: model_name.name, model_id: @id
end
end
end
end
2 changes: 1 addition & 1 deletion spec/models/concerns/hyrax/solr_document_behavior_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
end

it 'gives the global id for the valkyrie class' do
expect(solr_document.to_model.to_global_id.to_s).to end_with('Monograph/123')
expect(solr_document.to_model.to_global_id.to_s).to end_with('Hyrax::ValkyrieGlobalIdProxy/123')
end
end
end
Expand Down

0 comments on commit 90d49e6

Please sign in to comment.