Skip to content

Commit

Permalink
Use cached quoted_table_name instead of going through the connection
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva authored and robotex82 committed Nov 8, 2012
1 parent 838c5e8 commit 4995979
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/finder_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4995979

Please sign in to comment.