diff --git a/app/models/oai_set.rb b/app/models/oai_set.rb index 0aeda3f99..0383e4c59 100644 --- a/app/models/oai_set.rb +++ b/app/models/oai_set.rb @@ -57,8 +57,8 @@ def initialize(spec, opts = {}) private def name_from_spec - collection = Collection.find @spec - return nil if collection.collection_type.to_global_id.to_s != Hyrax::CollectionType.find_by(machine_id: :oai_set).to_global_id.to_s + collection = SolrDocument.find @spec + return nil if collection.collection_type_gid != Hyrax::CollectionType.find_by(machine_id: :oai_set).to_global_id Hyrax::SolrService.query("id:#{@value}", rows: 1).first['title_tesim'].first end diff --git a/spec/models/oai_set_spec.rb b/spec/models/oai_set_spec.rb index 870fa1ee3..20f0490fc 100644 --- a/spec/models/oai_set_spec.rb +++ b/spec/models/oai_set_spec.rb @@ -10,7 +10,7 @@ described_class.controller = controller described_class.fields = fields allow(controller).to receive(:params).and_return({}) - allow(ActiveFedora::Base).to receive(:find).and_return(coll) + allow(SolrDocument).to receive(:find).and_return(coll) end describe 'from_spec' do