diff options
Diffstat (limited to 'activerecord/test/models/post.rb')
-rw-r--r-- | activerecord/test/models/post.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index f2ab7b053e..affa37b02d 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -36,6 +36,10 @@ class Post < ActiveRecord::Base def find_most_recent find(:first, :order => "id DESC") end + + def newest + created.last + end end has_many :author_favorites, :through => :author |