In my model I have:
ListItem.update(item['id'], { :position => item['position'].to_i})
This can sometimes fail if there is a lot of activity resulting in the error:
ActiveRecord::RecordNotFound (Couldn't find ListItem with ID=322):
Is there a way to make this only update if found and keep going.. Right now the error kills everything.
Thanks
if you just want to keep going you could wrap it in
Or you could update the item after finding it first: