aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 650a91b385..e7319ce8b9 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1190,7 +1190,11 @@ module ActiveRecord #:nodoc:
# default_scope order('last_name, first_name')
# end
def default_scope(options = {})
- self.default_scoping << construct_finder_arel(options)
+ self.default_scoping << construct_finder_arel(options, default_scoping.pop)
+ end
+
+ def clear_default_scope
+ self.default_scoping.clear
end
def scoped_methods #:nodoc: