aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2013-07-02 07:08:12 +0530
committerNeeraj Singh <neerajdotname@gmail.com>2013-07-02 08:07:33 +0530
commit71db2420a1ffb73dad6fd4ca64be01e422c2b37d (patch)
tree6e1322befbbe91c47feb54477c8726f12fa9810c /activerecord/test/cases
parentaa3ff85f4700d3b1bec92eb963bff8c6e88529e5 (diff)
downloadrails-71db2420a1ffb73dad6fd4ca64be01e422c2b37d.tar.gz
rails-71db2420a1ffb73dad6fd4ca64be01e422c2b37d.tar.bz2
rails-71db2420a1ffb73dad6fd4ca64be01e422c2b37d.zip
calling default_scope without a proc will raise ArgumentError
Calling default_scope without a proc will now raise `ArgumentError`.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/scoping/named_scoping_test.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb
index 73ff8abb4e..abd0b8621a 100644
--- a/activerecord/test/cases/scoping/named_scoping_test.rb
+++ b/activerecord/test/cases/scoping/named_scoping_test.rb
@@ -445,14 +445,13 @@ class NamedScopingTest < ActiveRecord::TestCase
assert_equal [posts(:welcome).title], klass.welcome_2.map(&:title)
end
- def test_eager_default_scope_relations_are_deprecated
+ def test_eager_default_scope_relations_are_remove
klass = Class.new(ActiveRecord::Base)
klass.table_name = 'posts'
- assert_deprecated do
+ assert_raises(ArgumentError) do
klass.send(:default_scope, klass.where(:id => posts(:welcome).id))
end
- assert_equal [posts(:welcome).title], klass.all.map(&:title)
end
def test_subclass_merges_scopes_properly