diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2008-05-29 12:59:29 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-29 14:10:24 +0100 |
commit | 235d635708dd72bee0828457af5397c79750483a (patch) | |
tree | 51f09f956b8f4d84d6f0e81dd697d577ffcd7f92 /activerecord/lib/active_record | |
parent | cf6299dbd73a8cb6d74265df03d01abe885e686a (diff) | |
download | rails-235d635708dd72bee0828457af5397c79750483a.tar.gz rails-235d635708dd72bee0828457af5397c79750483a.tar.bz2 rails-235d635708dd72bee0828457af5397c79750483a.zip |
Ensure :select passed in options overrides the one from the scope. [#239 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record')
-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 c393128621..d2d9bda6ba 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1457,7 +1457,7 @@ module ActiveRecord #:nodoc: def construct_finder_sql(options) scope = scope(:find) - sql = "SELECT #{(scope && scope[:select]) || options[:select] || (options[:joins] && quoted_table_name + '.*') || '*'} " + sql = "SELECT #{options[:select] || (scope && scope[:select]) || (options[:joins] && quoted_table_name + '.*') || '*'} " sql << "FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} " add_joins!(sql, options, scope) |