Created
January 25, 2012 03:51
-
-
Save marcospereira/1674604 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Article extends Model { | |
public static List<Article> recents(int limit) { | |
return Article.find("order by publishedAt desc").fetch(limit); | |
} | |
public static Article mostPopular() { | |
return Article.find("order by views desc").first(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment