Suppose you have a Widget with a lock_version column.
If you try to do widget.previous_version.save!, you'll get a ActiveRecord::StaleObjectError.
I'm not sure how to override this. Ideally what should happen is that the newly reified object should have the same staleness / lock properties as the original object, so that if widget is OK to save then widget.previous_version should be too (since it hasn't changed out from under you).
Any ideas for how to implement this?
Suppose you have a Widget with a lock_version column.
If you try to do
widget.previous_version.save!, you'll get aActiveRecord::StaleObjectError.I'm not sure how to override this. Ideally what should happen is that the newly reified object should have the same staleness / lock properties as the original object, so that if
widgetis OK to save thenwidget.previous_versionshould be too (since it hasn't changed out from under you).Any ideas for how to implement this?