aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-05-17 15:41:22 +0100
committerPratik Naik <pratiknaik@gmail.com>2010-05-18 12:22:23 +0100
commit5ddc9049416e8b6093a7bb3ad4341694f7a14d9f (patch)
tree25c2531a9afc648509a664c61148836eb1546003 /activerecord
parentc53683595749dcfa223802669237480ac9ebc17f (diff)
downloadrails-5ddc9049416e8b6093a7bb3ad4341694f7a14d9f.tar.gz
rails-5ddc9049416e8b6093a7bb3ad4341694f7a14d9f.tar.bz2
rails-5ddc9049416e8b6093a7bb3ad4341694f7a14d9f.zip
Remove Model.clear_default_scope
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb4
-rw-r--r--activerecord/test/cases/method_scoping_test.rb12
2 files changed, 0 insertions, 16 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 18f75af11b..1b76f357e3 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1193,10 +1193,6 @@ module ActiveRecord #:nodoc:
self.default_scoping << construct_finder_arel(options, default_scoping.pop)
end
- def clear_default_scope
- self.default_scoping.clear
- end
-
def scoped_methods #:nodoc:
key = :"#{self}_scoped_methods"
Thread.current[key] = Thread.current[key].presence || self.default_scoping.dup
diff --git a/activerecord/test/cases/method_scoping_test.rb b/activerecord/test/cases/method_scoping_test.rb
index 3a6354ec6d..cb599e363f 100644
--- a/activerecord/test/cases/method_scoping_test.rb
+++ b/activerecord/test/cases/method_scoping_test.rb
@@ -587,18 +587,6 @@ class HasAndBelongsToManyScopingTest< ActiveRecord::TestCase
end
end
-class ClearDefaultScopeTest < ActiveRecord::TestCase
- fixtures :developers
-
- def test_should_clear_default_scope
- klass = Class.new(DeveloperCalledDavid)
- klass.__send__ :clear_default_scope
- expected = Developer.all.collect { |dev| dev.name }
- actual = klass.all.collect { |dev| dev.name }
- assert_equal expected, actual
- end
-end
-
class DefaultScopingTest < ActiveRecord::TestCase
fixtures :developers, :posts