3 ms·
Just tried it and it works fine. Feels a bit un-Railslike but it does exactly what you'd expect it to > Unit.where(ccp_id: 1).update_all("position = positi
by petepete 7y ago
Just tried it and it works fine. Feels a bit un-Railslike but it does exactly what you'd expect it to
> Unit.where(ccp_id: 1).update_all("position = position + 1")
Unit Update All (9.4ms) UPDATE "units" SET position = position + 1 WHERE "units"."ccp_id" = $1
=> 5