# Acts\_as\_list problem

**URL:** <https://www.ruby-forum.com/t/acts-as-list-problem/168974>\
**Category:** Rails\
**Created:** [May 27, 2009, 11:14pm UTC](https://www.ruby-forum.com/t/acts-as-list-problem/168974 "2009-05-27T23:14:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [May 27, 2009, 11:14pm UTC](https://www.ruby-forum.com/t/acts-as-list-problem/168974/1 "2009-05-27T23:14:54Z")

</div>

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!
