3235: Merge branch 'master' into 3235-top-nav-site-search
[arvados.git] / services / api / app / controllers / application_controller.rb
index 7e5b316c2d4bea89706896274e7da19ec22b245c..4a1a7d46dba7f1e7e2a765119c398ca96ae74685 100644 (file)
@@ -106,6 +106,7 @@ class ApplicationController < ActionController::Base
     end
     if @object and @object.errors and @object.errors.full_messages and not @object.errors.full_messages.empty?
       errors = @object.errors.full_messages
+      logger.error errors.inspect
     else
       errors = [e.inspect]
     end
@@ -351,6 +352,14 @@ class ApplicationController < ActionController::Base
   accept_param_as_json :reader_tokens, Array
 
   def render_list
+    if @select
+      # This information helps clients understand what they're seeing
+      # (Workbench always expects it), but they can't select it explicitly
+      # because it's not an SQL column.  Always add it.
+      # I believe this is safe because clients can always deduce what they're
+      # looking at by the returned UUID anyway.
+      @select |= ["kind"]
+    end
     @object_list = {
       :kind  => "arvados##{(@response_resource_name || resource_name).camelize(:lower)}List",
       :etag => "",