1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use cached quoted_table_name instead of going through the connection

This commit is contained in:
Carlos Antonio da Silva 2012-11-07 19:57:43 -02:00
parent 69ba5b46df
commit 688d9374c3

View file

@ -225,7 +225,7 @@ module ActiveRecord
def construct_limited_ids_condition(relation)
orders = relation.order_values.map { |val| val.presence }.compact
values = @klass.connection.distinct("#{@klass.connection.quote_table_name table_name}.#{primary_key}", orders)
values = @klass.connection.distinct("#{quoted_table_name}.#{primary_key}", orders)
relation = relation.dup