Last active
February 15, 2017 16:39
-
-
Save Chryus/cd9f8bc9e3267ea04e426035a526d68f 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
class User < ActiveRecord::Base | |
# ... | |
has_many :upvotes | |
has_many :graffiti, through: :upvotes, source: :upvotable, source_type: "Graffiti" | |
has_many :uploads, through: :upvotes, source: :upvotable, source_type: "Upload" | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment