Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/oai_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/models/oai_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down