aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-03-06 18:36:30 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-06 18:36:30 +0000
commit4863634a157a8e4a0033734617253b42325daf34 (patch)
tree0a13efa3a7a983731f48886dc6ddfa41781aae6f /activerecord/lib/active_record/base.rb
parentc896d56c6e5520346c260477f7d7f8bf951e72cc (diff)
downloadrails-4863634a157a8e4a0033734617253b42325daf34.tar.gz
rails-4863634a157a8e4a0033734617253b42325daf34.tar.bz2
rails-4863634a157a8e4a0033734617253b42325daf34.zip
Ensure supplie :from has precedence over scoped :from [#1370 state:resolved]
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 206b4efa38..ea791b5bfe 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1690,7 +1690,7 @@ module ActiveRecord #:nodoc:
def construct_finder_sql(options)
scope = scope(:find)
sql = "SELECT #{options[:select] || (scope && scope[:select]) || default_select(options[:joins] || (scope && scope[:joins]))} "
- sql << "FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} "
+ sql << "FROM #{options[:from] || (scope && scope[:from]) || quoted_table_name} "
add_joins!(sql, options[:joins], scope)
add_conditions!(sql, options[:conditions], scope)