cloudinary / cloudinary_gem

Cloudinary GEM for Ruby on Rails integration
https://cloudinary.com
420 stars 285 forks source link

replace update_all to update_column #525

Closed ollym closed 10 months ago

ollym commented 10 months ago

Using update_all is incompatible with optimistic locking and if you attempt to make further updates to the record it fails with ActiveRecord::StaleObjectError

Something like:

person = Person.find(1)
person.update!(avatar: '...file...')
person.update!(name: 'Oliver') # this will throw a ActiveRecord::StaleObjectError error
ollym commented 10 months ago

@wissam-khalili @const-cloudinary can you review this please?

wissam-khalili commented 10 months ago

Hi @ollym ,

Thank you for your input. I will ask the team to review your comments.

Thanks, Wissam

const-cloudinary commented 10 months ago

@ollym thank you for contribution!

ollym commented 10 months ago

Thanks @const-cloudinary any ETA on this making it into a release?