aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-06-17 15:10:57 -0300
committerEmilio Tagua <miloops@gmail.com>2009-06-17 15:10:57 -0300
commit3e4452c73f6f7ce2ff197b75d375f66f4a250a03 (patch)
tree23c81b463a113b06b30e088f9c172e0b31b5d987 /activerecord/lib
parent16ac353f4cb9510aad88240a1c566345da8ceeed (diff)
downloadrails-3e4452c73f6f7ce2ff197b75d375f66f4a250a03.tar.gz
rails-3e4452c73f6f7ce2ff197b75d375f66f4a250a03.tar.bz2
rails-3e4452c73f6f7ce2ff197b75d375f66f4a250a03.zip
Forget about auto scope, it's always explicit.
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 3f2b56d0c4..e04ec54913 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1736,7 +1736,7 @@ module ActiveRecord #:nodoc:
construct_finder_arel(options).to_sql
end
- def construct_join(joins, scope = :auto)
+ def construct_join(joins, scope)
merged_joins = scope && scope[:joins] && joins ? merge_joins(scope[:joins], joins) : (joins || scope && scope[:joins])
case merged_joins
when Symbol, Hash, Array
@@ -1753,13 +1753,12 @@ module ActiveRecord #:nodoc:
end
end
- def construct_group(group, having, scope = :auto)
+ def construct_group(group, having, scope)
sql = ''
if group
sql << group.to_s
sql << " HAVING #{sanitize_sql_for_conditions(having)}" if having
else
- scope = scope(:find) if :auto == scope
if scope && (scoped_group = scope[:group])
sql << scoped_group.to_s
sql << " HAVING #{sanitize_sql_for_conditions(scope[:having])}" if scope[:having]
@@ -1768,7 +1767,7 @@ module ActiveRecord #:nodoc:
sql
end
- def construct_order(order, scope = :auto)
+ def construct_order(order, scope)
orders = []
scoped_order = scope[:order] if scope
if order
@@ -1780,17 +1779,17 @@ module ActiveRecord #:nodoc:
orders
end
- def construct_limit(options, scope = :auto)
+ def construct_limit(options, scope)
options[:limit] ||= scope[:limit] if scope
options[:limit]
end
- def construct_offset(options, scope = :auto)
+ def construct_offset(options, scope)
options[:offset] ||= scope[:offset] if scope
options[:offset]
end
- def construct_conditions(conditions, scope = :auto)
+ def construct_conditions(conditions, scope)
conditions = [conditions]
conditions << scope[:conditions] if scope
conditions << type_condition if finder_needs_type_condition?