8567: If a search_term looks like a PDH, always treat it as one. Also use
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 14 Mar 2017 16:03:33 +0000 (12:03 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 14 Mar 2017 16:03:33 +0000 (12:03 -0400)
correct optional parameter syntax.

services/api/app/models/collection.rb

index 29e57254ff262414005ab7487937b84214a64a05..6d1a0d5b55f595fcaa30baf9937432eb88bc923c 100644 (file)
@@ -362,7 +362,7 @@ class Collection < ArvadosModel
   # Rails.configuration.docker_image_formats.  Will follow
   # 'docker_image_migration' links if search_term resolves to an incompatible
   # image, but an equivalent compatible image is available.
-  def self.find_all_for_docker_image(search_term, search_tag=nil, readers=nil, filter_compatible_format=true)
+  def self.find_all_for_docker_image(search_term, search_tag=nil, readers=nil, filter_compatible_formattrue)
     readers ||= [Thread.current[:user]]
     base_search = Link.
       readable_by(*readers).
@@ -386,9 +386,7 @@ class Collection < ArvadosModel
     if loc = Keep::Locator.parse(search_term)
       loc.strip_hints!
       coll_match = readable_by(*readers).where(portable_data_hash: loc.to_s).limit(1)
-      if compatible_img = get_compatible_images(readers, pattern, coll_match)
-        return compatible_img
-      end
+      return get_compatible_images(readers, pattern, coll_match)
     end
 
     if search_tag.nil? and (n = search_term.index(":"))