TIY-DC-ROR-2015-Jan / course-notes

Syllabus, notes, and more for the class
0 stars 3 forks source link

Sticky Pig #133

Open jamesdabbs opened 9 years ago

jamesdabbs commented 9 years ago

Due on Feb 11 @ 09:00am

Objectives

Learning Objectives

After completing this assignment, you should understand:

After completing this assignment, you be able to effectively use

A repo (based on our class skeleton) containing:

matthew-gould commented 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

jamesdabbs commented 9 years ago

I'm not sure if you've checked in the code you're working on / want me to look at. Do you mean this? What is Pighis?

This looks like a reasonable start ... now you need to look the Leaderboard back up after the game to update it. (A nitpick: use unless past instead of having an empty if branch.)

matthew-gould commented 9 years ago

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.

matthew-gould commented 9 years ago

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?

jamesdabbs commented 9 years ago

Looks good to me (modulo some indenting discipline). What makes you say you can't do Leaderboard.order(wins: :desc).limit(5)?