SHOW:
|
|
- or go back to the newest paste.
1 | def refac(user_id,score) | |
2 | - | score_card = RestaurantService::Promotion::MumbaiIndiansScorecard.where(:user_id => user_id).entries |
2 | + | score_card = RestaurantService::Promotion::MumbaiIndiansScorecard.where(:user_id => user_id).first |
3 | diff = (score*10) - score_card.match3 | |
4 | score_card.match3 += diff | |
5 | score_card.total += diff | |
6 | score_card.save | |
7 | end |