lib/ddr/utils.rb in ddr-models-1.17.1 vs lib/ddr/utils.rb in ddr-models-2.0.0.pre.1
- old
+ new
@@ -91,10 +91,10 @@
# items for an object with the given identifier)
def self.pid_for_identifier(identifier, opts={})
model = opts.fetch(:model, nil)
collection = opts.fetch(:collection, nil)
objs = []
- ActiveFedora::Base.find_each( { Ddr::IndexFields::IDENTIFIER => identifier }, { :cast => true } ) { |o| objs << o }
+ ActiveFedora::Base.find_each( { Ddr::IndexFields::IDENTIFIER_ALL => identifier }, { :cast => true } ) { |o| objs << o }
pids = []
objs.each { |obj| pids << obj.pid }
if model.present?
objs.each { |obj| pids.delete(obj.pid) unless obj.is_a?(model.constantize) }
end