diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-04-02 17:34:48 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-04-02 17:38:02 +0100 |
commit | b77dd218ce845f01753d02fcbc2605c9a5ee93e1 (patch) | |
tree | ea07dbe6965bd31ea7d066e04f7dad0e67e62f31 /activerecord/test/models | |
parent | bc7da9b77d6347eeccefa2c735b2f236a08eea57 (diff) | |
download | rails-b77dd218ce845f01753d02fcbc2605c9a5ee93e1.tar.gz rails-b77dd218ce845f01753d02fcbc2605c9a5ee93e1.tar.bz2 rails-b77dd218ce845f01753d02fcbc2605c9a5ee93e1.zip |
Add Relation extensions
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/post.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index 704313649a..d092c4bf09 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -1,4 +1,10 @@ class Post < ActiveRecord::Base + module NamedExtension + def author + 'lifo' + end + end + scope :containing_the_letter_a, where("body LIKE '%a%'") scope :ranked_by_comments, order("comments_count DESC") scope :limit_by, lambda {|l| limit(l) } |