diff --git a/lib/hyrax/active_fedora_dummy_model.rb b/lib/hyrax/active_fedora_dummy_model.rb index add9ffe8a8..0ae1dcb8de 100644 --- a/lib/hyrax/active_fedora_dummy_model.rb +++ b/lib/hyrax/active_fedora_dummy_model.rb @@ -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 diff --git a/spec/models/concerns/hyrax/solr_document_behavior_spec.rb b/spec/models/concerns/hyrax/solr_document_behavior_spec.rb index 68ba59dcff..d619e7cb09 100644 --- a/spec/models/concerns/hyrax/solr_document_behavior_spec.rb +++ b/spec/models/concerns/hyrax/solr_document_behavior_spec.rb @@ -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