Currently, we have a game reset button on the administration page. It works like this:
User hits the route /reset_game, this goes to the Games Controller and hits the reset method.
The reset method grabs the user's Game It calls that Game's reset method which does some stuff (delete and initialize game data) and then does some additional cleanup tasks wiping out other model data.
As we move to multiple games operating in the app, we need to update this.
[x] Make sure we don't wipe out the game's internal name when we reset.
[x] Ensure that the user is an admin user for that game and therefore can reset the game.
[x] The game resetting code should all be moved into the Game model instead of living in the controller. This means you will also update creating the terror tracker so that instead of using Game.last.round it uses self.round
[ ] Game should called Tweet.import after deleting all tweets which should generate 3 tweets/news messages into database. You will need a .yml file with the keys for tweeting to test with. This will be sent separately to you for obvious reasons.
[x] The Game Reset needs to also reset Incomes. For now, delete all existing Incomes, then re-initialize one for each country. Check the seeds.rb to see an example.
You will notice that we are doing some very drastic stuff in the reset method like delete all of the tweets or all of the news messages from the database. This is on purpose because the schema changes connecting a game to all of its tweets or news messages or PR's isn't there yet. Rest assured, those connections will be handled by someone else and you don't have to worry about it. Game will be updated so it knows how to access its own PR for example and so a call to PublicRelation.delete_all will be changed with self.publicrelations.delete_all in a separate pr.
Users should be deleted except for admin/superadmin users.
This was completed. Tweet import was stubbed out which is fine. Probably should implement VCR and record a message back from Twitter. That or just better stub out Tweet.import so that it creates a tweet.
Currently, we have a game reset button on the administration page. It works like this:
User hits the route /reset_game, this goes to the Games Controller and hits the reset method.
The reset method grabs the user's Game It calls that Game's reset method which does some stuff (delete and initialize game data) and then does some additional cleanup tasks wiping out other model data.
As we move to multiple games operating in the app, we need to update this.
You will notice that we are doing some very drastic stuff in the reset method like delete all of the tweets or all of the news messages from the database. This is on purpose because the schema changes connecting a game to all of its tweets or news messages or PR's isn't there yet. Rest assured, those connections will be handled by someone else and you don't have to worry about it. Game will be updated so it knows how to access its own PR for example and so a call to PublicRelation.delete_all will be changed with self.publicrelations.delete_all in a separate pr.
Users should be deleted except for admin/superadmin users.