Skip to content

Compatibility problems with optimistic locking / lock_version #163

@saizai

Description

@saizai

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions