diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-04-17 20:47:52 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-04-17 20:47:52 +0100 |
commit | 256b363eeecf6d0fb896aabd3fc619e200a5062c (patch) | |
tree | c8dfbb127ceb2c13786d5206807e0c54d4ab0131 /activerecord/test/models/comment.rb | |
parent | d1f10e74caaedbc853d0f875d8e2a2ac16899fa0 (diff) | |
download | rails-256b363eeecf6d0fb896aabd3fc619e200a5062c.tar.gz rails-256b363eeecf6d0fb896aabd3fc619e200a5062c.tar.bz2 rails-256b363eeecf6d0fb896aabd3fc619e200a5062c.zip |
Revert "Deprecate defining scopes with a callable (lambda, proc, etc) via the scope class method. Just define a class method yourself instead."
This reverts commit f0e198bfa1e3f9689e0cde1d194a44027fc90b3c.
Conflicts:
activerecord/test/models/post.rb
Diffstat (limited to 'activerecord/test/models/comment.rb')
-rw-r--r-- | activerecord/test/models/comment.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/test/models/comment.rb b/activerecord/test/models/comment.rb index 3bd7db7834..2a4c37089a 100644 --- a/activerecord/test/models/comment.rb +++ b/activerecord/test/models/comment.rb @@ -1,8 +1,5 @@ class Comment < ActiveRecord::Base - def self.limit_by(l) - limit(l) - end - + scope :limit_by, lambda {|l| limit(l) } scope :containing_the_letter_e, :conditions => "comments.body LIKE '%e%'" scope :not_again, where("comments.body NOT LIKE '%again%'") scope :for_first_post, :conditions => { :post_id => 1 } |