Created
March 7, 2011 19:24
-
-
Save DCarper/859031 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # i need the 5 most recent guesses | |
| # option1 - scope on guesses | |
| @bracket.guesses.most_recent(5) | |
| # option2 - relationship that overlaps with bracket has_many :guesses | |
| @bracket.five_most_recent_guesses | |
| #option3 - an explicit method on the bracket instance | |
| @bracket.five_most_recent_guesses which just runs it's own hard coded query |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment