Forum: Ruby on Rails acts_as_list problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ca34930c48de6831d3162b9631e62b5e?d=identicon&s=25 Ben (Guest)
on 2009-05-27 23:14
(Received via mailing list)
Using the acts_as_list pluging and I've hit a wall.

I'm using the lock_version column as the :version_column. If I revert
the current version to a previous one, then edit it and save it, I
don't get the next logical version number, I get the lock_version + 1.
So the version numbers in the _versions table end up going 1,2,3
(revert to version 1), 2, not 1,2,3,4

If I use just the default version column everything works as expected.
Great I thought I'll use the pair of them so a version column to track
the version number and lock_version for optimistic locking, however,
the plugin still detects locking_enabled? so these two don't work
properly together and the version column never gets updated.

So I can hack the plugin and simply remove the locking_enabled? check,
that's easy and works. But there must be a neater way, I've seen a
previous thread where there is talk about :extend or block syntax. How
can this be used? Is it appropriate to use it to override the
set_new_version method?

Any help would be much appreciated. Thanks!
This topic is locked and can not be replied to.