diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-04-08 23:54:54 +0100 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-12 19:46:05 -0700 |
commit | f0e198bfa1e3f9689e0cde1d194a44027fc90b3c (patch) | |
tree | 2da93eee8e63c088350971c04b80cd673f1b5333 /activerecord/test/models/comment.rb | |
parent | 788bd30859f3f21184defd240c3d32f179515225 (diff) | |
download | rails-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/models/comment.rb')
-rw-r--r-- | activerecord/test/models/comment.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/test/models/comment.rb b/activerecord/test/models/comment.rb index 2a4c37089a..3bd7db7834 100644 --- a/activerecord/test/models/comment.rb +++ b/activerecord/test/models/comment.rb @@ -1,5 +1,8 @@ class Comment < ActiveRecord::Base - scope :limit_by, lambda {|l| limit(l) } + def self.limit_by(l) + limit(l) + end + 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 } |