There's a field in my User model that sometimes needs bulk
updates:
User.update_all("cluster = #",
"cluster = #
")
Now, suppose user with id 37 is affected by that particular
update_all and updates his profile:
1. user 37 is read
2. update_all happens and changes 37's cluster
asynchronously
3. user 37 is saved
now user 37 belongs to the wrong cluster. Unlikely but
possible. Is
there a robust way to write that?
-- fxn
_______________________________________________
Rails mailing list
Rails lists.rubyonrails.org
h
ttp://lists.rubyonrails.org/mailman/listinfo/rails
|