Open jamesdabbs opened 9 years ago
Uhhhhh... I can't get this to work. I can get names into the leaderboard... My implementation of the adding wins/losses wasn't working.
git@github.com:matthew-gould/PigHistory.git
Sorry.. I meant to delete that. That was my first attempt when I screwed up all the migration names/etc. What I was working on was actually in the pig file (which you found).
I wasn't sure how to get the losses recorded. I was going to put some code into the remove_losing_player function but I wasn't sure how to recall the "past" or leaderboard to tell it to update.
Alrighty... I got a working leaderboard that prints for the winner at the end.
git@github.com:matthew-gould/PigHistory.git
I wanted to do something that would print like Leaderboard.order(wins: :desc).limit(5) or something, but apparently we can't do that?
Looks good to me (modulo some indenting discipline). What makes you say you can't do Leaderboard.order(wins: :desc).limit(5)
?
Due on Feb 11 @ 09:00am
Objectives
Learning Objectives
After completing this assignment, you should understand:
Performance Objectives
After completing this assignment, you be able to effectively use
ActiveRecord
to interact with data storesDetails
Deliverables
A repo (based on our class skeleton) containing:
ruby play.rb
should play a game of pigruby leaderboard.rb
should display the winningist playersNormal Mode
Hard Mode
References
ActiveRecord
gem being a Ruby implementation of that general idea).