Permalink
Browse files

Use cached quoted_table_name instead of going through the connection

  • Loading branch information...
1 parent 69ba5b4 commit 688d9374c33afc2a3df50f2b1f4cebc077cd96ae @carlosantoniodasilva carlosantoniodasilva committed Nov 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/finder_methods.rb
@@ -225,7 +225,7 @@ def apply_join_dependency(relation, join_dependency)
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

0 comments on commit 688d937

Please sign in to comment.