Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

facepalm

I forgot a very important part of the query:

row_count = Goal.update_all "completed = true", ["player_id = ? AND completed = false", player.id]

If you update where completed = false, the rowcount will only be 1 when the update works.

(I've updated the blog post.)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: