Skip to content

Instantly share code, notes, and snippets.

@marcospereira
Created January 25, 2012 03:51
Show Gist options
  • Save marcospereira/1674604 to your computer and use it in GitHub Desktop.
Save marcospereira/1674604 to your computer and use it in GitHub Desktop.
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