diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-10 17:01:15 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-10 17:01:15 -0800 |
commit | de708447f4bc2ae692440bbac235f9fe04f0702f (patch) | |
tree | 7d8f7bbc4360d70366607dbaab1cae68e145561b /activerecord/lib/active_record/associations/class_methods/join_dependency.rb | |
parent | 9e16254b4661f0ec55f035f62e70148827dcdf56 (diff) | |
download | rails-de708447f4bc2ae692440bbac235f9fe04f0702f.tar.gz rails-de708447f4bc2ae692440bbac235f9fe04f0702f.tar.bz2 rails-de708447f4bc2ae692440bbac235f9fe04f0702f.zip |
combine regexp
Diffstat (limited to 'activerecord/lib/active_record/associations/class_methods/join_dependency.rb')
-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) |