Created
October 4, 2016 13:25
-
-
Save meagar/af327fbca81dcabaeee2320d2b5f680a 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
# This is pure data, it's the definition of a category | |
class Category | |
has_many :clues | |
# name: string | |
end | |
# This is pure data, it's the definition of a category, it's not tied to any user or game | |
class Clue | |
belongs_to :category | |
# answer: string | |
# question: string | |
end | |
# This ties a specific user to a set of clues through GameClue | |
class Game | |
belongs_to :user | |
has_many :game_clues | |
end | |
# This ties together a Game, a Clue and the user's inputted answer | |
class GameClue | |
belongs_to :game | |
belongs_to :clue | |
belongs_to :inputted_user_answer # Nil until a user inputs an answer | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment