diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-10 17:01:15 -0800 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-16 01:49:28 +0530 |
commit | 59bd9c2a3793febffb919f1555156208825d4a9c (patch) | |
tree | 963e502aafbef3f1f393ed715ffe2dd4828078ab /activerecord/lib/active_record/associations | |
parent | b3ae67dbb91a79f0f58528ba0ba4ffe592db1924 (diff) | |
download | rails-59bd9c2a3793febffb919f1555156208825d4a9c.tar.gz rails-59bd9c2a3793febffb919f1555156208825d4a9c.tar.bz2 rails-59bd9c2a3793febffb919f1555156208825d4a9c.zip |
combine regexp
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/class_methods/join_dependency.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/class_methods/join_dependency.rb b/activerecord/lib/active_record/associations/class_methods/join_dependency.rb index b6d85a7c7d..6be947df41 100644 --- a/activerecord/lib/active_record/associations/class_methods/join_dependency.rb +++ b/activerecord/lib/active_record/associations/class_methods/join_dependency.rb @@ -66,10 +66,8 @@ module ActiveRecord end def count_aliases_from_string(join_sql, name) - # Table names - join_sql.scan(/join(?:\s+\w+)?\s+#{name}\son/).size + - # Table aliases - join_sql.scan(/join(?:\s+\w+)?\s+\S+\s+#{name}\son/).size + # Table names + table aliases + join_sql.scan(/join(?:\s+\w+)?\s+(\S+\s+)?#{name}\son/).size end def instantiate(rows) |