lib/solrizer/fedora/solrizer.rb in solrizer-fedora-1.1.1 vs lib/solrizer/fedora/solrizer.rb in solrizer-fedora-1.1.2

- old
+ new

@@ -43,22 +43,20 @@ begin start = Time.now logger.debug "SOLRIZER Retrieving object #{obj} ..." - case obj - when ActiveFedora::Base + + if obj.instance_of? ActiveFedora::Base # do nothing - when Fedora::FedoraObject - obj = Repository.get_object( obj.pid ) - when String + elsif obj.kind_of? String obj = Repository.get_object( obj ) + elsif obj.respond_to? :pid + obj = Repository.get_object( obj.pid ) else raise "you must pass either a ActiveFedora::Base, Fedora::RepositoryObject, or a String. You submitted a #{obj.class}" end - - # obj = obj.kind_of?(ActiveFedora::Base) ? obj : Repository.get_object( obj ) obj_done = Time.now obj_done_elapse = obj_done - start logger.debug " completed. Duration: #{obj_done_elapse}" @@ -120,6 +118,6 @@ end #if Index_LISTS end #solrize_objects end #class -end #module \ No newline at end of file +end #module