Hi, I''m using aav(0.2.1)
not using :if
@your_model.version_condition_met? return true
@your_model.send(:next_version) return 2
I''ve try to test it, the problem is caused by lock_version field.
1) I have a lock_version field prior to version. the lock_version
increment, but the version doesn''t increament.
If I remove the lock_version field, or move the lock_version field after
version field, it will work, however the lock_version will remain
''null''.
Do not not need a lock_version field for optimisic locking if I have a
version field?
-----Original Message-----
From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On
Behalf Of Rick Olson
Sent: Monday, October 10, 2005 2:29 PM
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: Re: [Rails] acts_as_version, version not increment
On 10/10/05, Paul Chin <paulchin-0SqPFV7GnR3FK4RKhr3rmg@public.gmane.org>
wrote:> Hi all I having problem of the version field not incrementing. It aways
> stays at 1.
> I have got a _versions table, version field, everything works fine, just
the> version field not incrementing
Hmm, not much info...
Are you on the latest version of aav (0.2.1)?
Are you using the :if or :if_changed options?
Try @your_model.version_condition_met? to see if it returns true.
Also try @your_model.send(:next_version) and make sure that returns
something...
Look at the source to aid in your debugging...
http://collaboa.techno-weenie.net:2533/repository/file/acts_as_versioned/lib
/acts_as_versioned.rb
--
rick
http://techno-weenie.net
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails