trigun0x2/hearthstats — pull request #115 by JeromeDane (2014-02-13 17:54:33+00:00)
Title: [Staging] Global deck list and stats

rake db:migrate

I put the basic infrastructure in place in order to have a public deck list and global deck stats. I've created a `unique_decks` table to hold cached global statistical data across all decks that use the same specific card combinations.

The public deck list page works by only showing each unique possible combination of hero class and cards. Whoever lists a deck with a given combination of cards first is the one that gets credit for it on the public deck list. I have yet to implement the privacy checkbox we talked about. Will do in the next pull request.

You will notice that there is some data that is duplicated in static form such as `unique_deck.num_matches` etc. Yes, this could be calculated on the fly at any time, but doing so would make the public deck list load very slowly. I have modified the models so that each unique deck has its stats updated whenever a new match is created.

I still have more work to do, but go ahead and pull and test this if you would so we can make sure things are going alright so far.