aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-04-08 23:54:54 +0100
committerAaron Patterson <aaron.patterson@gmail.com>2011-04-12 19:46:05 -0700
commitf0e198bfa1e3f9689e0cde1d194a44027fc90b3c (patch)
tree2da93eee8e63c088350971c04b80cd673f1b5333 /activerecord/test/cases
parent788bd30859f3f21184defd240c3d32f179515225 (diff)
downloadrails-f0e198bfa1e3f9689e0cde1d194a44027fc90b3c.tar.gz
rails-f0e198bfa1e3f9689e0cde1d194a44027fc90b3c.tar.bz2
rails-f0e198bfa1e3f9689e0cde1d194a44027fc90b3c.zip
Deprecate defining scopes with a callable (lambda, proc, etc) via the scope class method. Just define a class method yourself instead.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/named_scope_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb
index 8fd1fc2577..2880fdc651 100644
--- a/activerecord/test/cases/named_scope_test.rb
+++ b/activerecord/test/cases/named_scope_test.rb
@@ -471,6 +471,12 @@ class NamedScopeTest < ActiveRecord::TestCase
require "models/without_table"
end
end
+
+ def test_scopes_with_callables_are_deprecated
+ assert_deprecated do
+ Post.scope :WE_SO_EXCITED, lambda { |partyingpartyingpartying, yeah| fun!.fun!.fun! }
+ end
+ end
end
class DynamicScopeMatchTest < ActiveRecord::TestCase