copasetickid / draftsman

Ruby gem that lets you create draft versions of your database records.
MIT License
168 stars 62 forks source link

Only update attributes that get changed instead of all of them #58

Closed npezza93 closed 7 years ago

npezza93 commented 7 years ago

Currently when calling #save_draft on an object that is getting updated, it updates all columns no matter if they have changed or not. This only updates the changed columns.

I had run into an issue when a column has a mounted_uploader and an error gets thrown: TypeError: can't quote ImageUploader. I handle images in a different form not using draftsman so it shouldn't be getting called when updating the record. It would also seem Carrierwave's upgrade to 1.0.0 has broken some stuff which is what is causing the TypeError but that's a separate issue.

chrisdpeters commented 7 years ago

Thank you, @npezza93. Anything that we can do to make this gem more efficient is a big win.