Hello,
I am planning a relational database to store poker game data (like what would be included in the hand histories). I would like help figuring out how to design the associations. It seems like there should be 4 models: Game, Hand, Player, and Action (single action of a given player, like raise, fold, call). Let me lay out what I have:
class Game < ActiveRecord::Base
has_many :hands
has_many :actions
has_and_belongs_to_many :players
end
class Hand < ActiveRecord::Base
has_many :actions
belongs_to :game
has_and_belongs_to_many :players
end
class Action < ActiveRecord::Base
belongs_to :game
belongs_to :hand
belongs_to :player
end
class Player < ActiveRecord::Base
has_and_belongs_to_many :games
has_and_belongs_to_many :hands
has_many :actions
end
Does this make sense?