aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-02-11 02:50:58 +0000
committerMichael Koziarski <michael@koziarski.com>2008-02-11 02:50:58 +0000
commitd4daf7bba7dda756ab4700016e9b4b31f6127a1e (patch)
treee8b3be3a047e66b17584f7dd14db7351ccbae904 /activerecord/lib
parentc9402b2277b18e65064720cc9ebf272a321de1ff (diff)
downloadrails-d4daf7bba7dda756ab4700016e9b4b31f6127a1e.tar.gz
rails-d4daf7bba7dda756ab4700016e9b4b31f6127a1e.tar.bz2
rails-d4daf7bba7dda756ab4700016e9b4b31f6127a1e.zip
Fix eager loading with pre-quoted table names. Closes #11046 [danielmorrison, Koz, Jeremy Kemper]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8856 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index cb17b6e483..3ff2d5db6b 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1379,7 +1379,7 @@ module ActiveRecord
end
end
return false unless conditions.any?
- conditions.join(' ').scan(/([\.\w]+)\.\w+/).flatten.any? do |condition_table_name|
+ conditions.join(' ').scan(/([\.\w]+).?\./).flatten.any? do |condition_table_name|
condition_table_name != table_name
end
end
@@ -1388,7 +1388,7 @@ module ActiveRecord
def include_eager_order?(options)
order = options[:order]
return false unless order
- order.to_s.scan(/([\.\w]+)\.\w+/).flatten.any? do |order_table_name|
+ order.to_s.scan(/([\.\w]+).?\./).flatten.any? do |order_table_name|
order_table_name != table_name
end
end