diff options
author | Mark Catley <mark@nexx.co.nz> | 2008-06-21 23:41:30 +1200 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-22 19:21:15 -0700 |
commit | 0fd3e4cd2b2b1b31304a922dc65284d5363f78b6 (patch) | |
tree | 512a7018a967141c3762c0553e25f5dc4851e70f /activerecord/lib | |
parent | bb6e8eea5a8190aaab67da0a7efedb3bb3d9fccb (diff) | |
download | rails-0fd3e4cd2b2b1b31304a922dc65284d5363f78b6.tar.gz rails-0fd3e4cd2b2b1b31304a922dc65284d5363f78b6.tar.bz2 rails-0fd3e4cd2b2b1b31304a922dc65284d5363f78b6.zip |
Fix column collision with named_scope and :joins. [#46 state:resolved]
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 8d5ea271a7..e6ab87e8fc 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1479,7 +1479,7 @@ module ActiveRecord #:nodoc: def construct_finder_sql(options) scope = scope(:find) - sql = "SELECT #{options[:select] || (scope && scope[:select]) || (options[:joins] && quoted_table_name + '.*') || '*'} " + sql = "SELECT #{options[:select] || (scope && scope[:select]) || ((options[:joins] || (scope && scope[:joins])) && quoted_table_name + '.*') || '*'} " sql << "FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} " add_joins!(sql, options, scope) |