Skip to content

dgmdan/raceto13

Folders and files

NameName
Last commit message
Last commit date
Jan 6, 2018
Apr 6, 2024
Apr 21, 2024
Apr 6, 2024
Nov 24, 2024
Apr 6, 2024
Apr 20, 2024
Feb 28, 2015
Nov 14, 2022
Apr 6, 2024
Apr 6, 2024
Feb 28, 2015
Apr 21, 2024
May 22, 2015
Apr 20, 2024
Apr 6, 2024
Nov 24, 2024
Apr 21, 2024
Jun 24, 2015
Jan 7, 2018
Apr 6, 2024
Apr 6, 2024

Repository files navigation

MLB Runs Pool Game

This is a simple office pool game based on MLB scores. The basic rules are:

  • Players sign up and buy one or more entries
  • At the beginning of the MLB season, each entry is randomly assigned a team
  • The first team with final run scores matching every number from 0 to 13 wins

The more complete set of rules are in entries/index.html.erb

Rake tasks to know

  • Use rake import_data:teams to create Team records for all MLB teams by scraping ESPN data.
  • Use rake game_state:assign_teams to randomly assign MLB teams to unassigned Entries.
  • Use rake import_data:advance to scrape ESPN for scores and check for winners. Date range starts on the first day without a Game or the first day of the 2015 season, if there are no games. Date range ends one day before the current date.
  • Use rake game_state:reset to erase all scores. Users and entries are retained but team assignment and winner info fields are cleared.
  • Use rake game_state:assign_notifications to create NotificationTypeUser records so all users get email alerts on new hits and when the league ends.

TODO

  • Live scores of in progress games on the scoreboard