3 ms·
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 y
by EvilTrout 14y ago
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.)