11629: Fix ambiguous column reference.
authorTom Clegg <tom@curoverse.com>
Wed, 10 May 2017 14:22:42 +0000 (10:22 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 10 May 2017 14:22:42 +0000 (10:22 -0400)
services/api/app/controllers/application_controller.rb

index 6bac512043706c70675ef333ab4ff535894c4662..b6816d35c70a589278b2c39bc54370a896636e62 100644 (file)
@@ -283,7 +283,7 @@ class ApplicationController < ActionController::Base
       limit_query = @objects.
         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|