From a84a20e1cd2133932dd1bd33f862aa2605cc821e Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sat, 14 Jan 2012 21:14:21 +0000 Subject: store references as a string --- activerecord/lib/active_record/relation.rb | 2 +- activerecord/lib/active_record/relation/query_methods.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index dcfce448b1..7838271e5c 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -522,7 +522,7 @@ module ActiveRecord joined_tables = joined_tables.flatten.compact.map { |t| t.downcase }.uniq (tables_in_string(to_sql) - joined_tables).any? || - (includes_values & references_values).any? + (references_values - joined_tables).any? end def tables_in_string(string) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index ef3545c76a..75369513e3 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -52,7 +52,7 @@ module ActiveRecord return self if args.blank? relation = clone - relation.references_values = (references_values + args).flatten.uniq + relation.references_values = (references_values + args.flatten.map(&:to_s)).uniq relation end -- cgit v1.2.3