Merge branch '2640-folder-api' into 1970-folder-view
[arvados.git] / services / api / app / controllers / application_controller.rb
index e93c2abb56e758eb2b66a8b291c41275c0d39177..8f3a6bc71bc02a5533c89303acd06ad432921693 100644 (file)
@@ -83,16 +83,14 @@ class ApplicationController < ActionController::Base
     offset_all = @offset
     @orders = []
 
-    ArvadosModel.descendants.
-      reject(&:abstract_class?).
-      sort_by(&:to_s).
+    ArvadosModel.descendants.reject(&:abstract_class?).sort_by(&:to_s).
       each do |klass|
       case klass.to_s
         # We might expect klass==Link etc. here, but we would be
         # disappointed: when Rails reloads model classes, we get two
         # distinct classes called Link which do not equal each
         # other. But we can still rely on klass.to_s to be "Link".
-      when 'ApiClientAuthorization', 'UserAgreement'
+      when 'ApiClientAuthorization', 'UserAgreement', 'Link'
         # Do not want.
       else
         @objects = klass.readable_by(*@read_users)
@@ -114,8 +112,7 @@ class ApplicationController < ActionController::Base
       end
     end
     @objects = all_objects || []
-    @links = Link.where('link_class=? and owner_uuid=?'\
-                        ' and owner_uuid=tail_uuid'\
+    @links = Link.where('link_class=? and tail_uuid=?'\
                         ' and head_uuid in (?)',
                         'name',
                         @object.uuid,