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.)
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.)