jcazevedo/pawned

Insert match with date prior to player criation

Closed this issue · 2 comments

When inserting a match with a date that is before the player was created, boom goes the dynamite with an error in 'update_ratings', as it tries to get the value of a rating that does not exist.

I can take this. I see two alternatives for this:

  1. Disallow the creation of matches prior to the registration date of each of the players.
  2. Push the initial rating of the player to before the match.

I prefer the latter. It is not hard to implement and, as far as I can tell, there won't be any inconsistencies in the ratings.

I'm having a different approach after all. Since the initial rating date is not that important, I'm setting it to the epoch time.