Skip to content

Instantly share code, notes, and snippets.

@pius
Created December 4, 2009 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pius/249250 to your computer and use it in GitHub Desktop.
Save pius/249250 to your computer and use it in GitHub Desktop.
Ruby console for rebirth.heroku.com
>> c = Choice.find 169
=> #<Choice id: 169, item_id: 169, question_id: 1, position: nil, wins: nil, ratings: nil, losses: nil, created_at: "2009-12-03 21:36:40", updated_at: "2009-12-04 18:50:45", request_id: nil, prompt_id: nil, active: false, tracking: nil, score: 36.3636363636364, local_identifier: nil, prompts_on_the_left_count: 279, prompts_on_the_right_count: 279, votes_count: 4, loss_count: 7, prompts_count: 562>
>> c.wins
=> 4
>> c.losses
=> 7
>> times_competing = c.wins_plus_losses
=> 11
>> c.wins / times_competing
=> 0
>> c.wins / times_competing.to_f
=> 0.363636363636364
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment