Merge branch '3411-expire-collections'
[arvados.git] / services / api / app / controllers / arvados / v1 / groups_controller.rb
index 17be40a57ee449a6a0902409ed1aa9ae7853be8a..9fca207dd2140c858a87708d4879ed12fa096919 100644 (file)
@@ -6,6 +6,8 @@ class Arvados::V1::GroupsController < ApplicationController
               uuid: {
                 type: 'string', required: false, default: nil
               },
+              # include_linked returns name links, which are obsolete, so
+              # remove it when clients have been migrated.
               include_linked: {
                 type: 'boolean', required: false, default: false
               },
@@ -34,6 +36,8 @@ class Arvados::V1::GroupsController < ApplicationController
 
   def contents
     # Set @objects:
+    # include_linked returns name links, which are obsolete, so
+    # remove it when clients have been migrated.
     load_searchable_objects(owner_uuid: @object.andand.uuid,
                             include_linked: params[:include_linked])
     sql = 'link_class=? and head_uuid in (?)'
@@ -82,12 +86,6 @@ class Arvados::V1::GroupsController < ApplicationController
         cond_params = []
         conds << "#{klass.table_name}.owner_uuid = ?"
         cond_params << opts[:owner_uuid]
-        if opts[:include_linked]
-          haslink = "#{klass.table_name}.uuid IN (SELECT head_uuid FROM links WHERE link_class=#{klass.sanitize 'name'}"
-          haslink += " AND links.tail_uuid=#{klass.sanitize opts[:owner_uuid]}"
-          haslink += ")"
-          conds << haslink
-        end
         if conds.any?
           cond_sql = '(' + conds.join(') OR (') + ')'
           @objects = @objects.where(cond_sql, *cond_params)
@@ -96,7 +94,7 @@ class Arvados::V1::GroupsController < ApplicationController
 
       @objects = @objects.order("#{klass.table_name}.uuid")
       @limit = limit_all - all_objects.count
-      apply_where_limit_order_params
+      apply_where_limit_order_params klass
       klass_items_available = @objects.
         except(:limit).except(:offset).
         count(:id, distinct: true)