9587: expose untrash api
[arvados.git] / services / api / app / controllers / application_controller.rb
index 2bf7952dc60935d2f10aea00d8c2a699f1dfc805..b6816d35c70a589278b2c39bc54370a896636e62 100644 (file)
@@ -281,9 +281,9 @@ class ApplicationController < ActionController::Base
     return if limit_columns.empty?
     model_class.transaction do
       limit_query = @objects.
-        except(:select).
+        except(:select, :distinct).
         select("(%s) as read_length" %
-               limit_columns.map { |s| "octet_length(#{s})" }.join(" + "))
+               limit_columns.map { |s| "octet_length(#{model_class.table_name}.#{s})" }.join(" + "))
       new_limit = 0
       read_total = 0
       limit_query.each do |record|