Optimistic Locking
...
- add bit field to question_format so we don't have to test strings to determine format
- add isOptionBased to question so we dn't have to do multiple string comps for this - there was a boolean already in the DB not being used
- add migration to add bit field
- add migration to add lock_version field to answer
- change answers_controller to do optimistic locking
- change answers controller not to redirect to plans/phase/edit as it wasn't doing anything
- introduced answers/update.js.erb to handle the return from /answers/update.
- to do the conflict resolution you need the old answer and new answer objects. Tried using clone but it doesn't work because it only does a shallow copy. So adopted a "nuclear-option" deep copy but it's a bit much. A compromise would be better.
ray.carrick
committed
on 1 Mar 2017