Created
March 19, 2012 10:27
-
-
Save gobijan/2106782 to your computer and use it in GitHub Desktop.
Referencing the same Model type under another name...
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
Post | |
has_many :upvotes <= Model: Vote | |
has_many :downvotes <= Model: Vote | |
Vote | |
Fields: user_id, comment | |
belongs_to :post <= as an upvote or downvote.. | |
What I want to achieve: | |
Post.upvotes.first().comment | |
and stuff like this... | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment