Acts_as_versioned issues


#1

I’m in the midst of an upgrade from Rails 2.0.2 to 2.1.1. We were
using an older version of acts_as_versioned and after upgrading both
Rails and acts_as_versioned we have 146 tests failing, mostly
acts_as_versioned related.

[snip the 140 or so identical failing tasks]
145)
NoMethodError in ‘TaskTemplate should not re-create tasks for parts’
undefined method version=' for #<Part::Version:0x3e3b2fc> /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/ attribute_methods.rb:251:inmethod_missing’
/Users/sporkmonger/Projects/Ruby/RailsSites/day/mojo/core/vendor/
plugins/acts_as_versioned/lib/acts_as_versioned.rb:276:in send' /Users/sporkmonger/Projects/Ruby/RailsSites/day/mojo/core/vendor/ plugins/acts_as_versioned/lib/acts_as_versioned.rb:276:insave_version’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/
callbacks.rb:173:in send' /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/ callbacks.rb:173:inevaluate_method’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/
callbacks.rb:161:in call' /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/ callbacks.rb:93:inrun’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/
callbacks.rb:92:in each' /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/ callbacks.rb:92:insend’
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/
callbacks.rb:92:in run' /Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/ callbacks.rb:272:inrun_callbacks’
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/
callbacks.rb:298:in callback' /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/ callbacks.rb:208:increate_or_update’
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/
base.rb:2211:in save_without_validation' /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/ validations.rb:911:insave_without_dirty’
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/
dirty.rb:75:in save_without_transactions' /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/ transactions.rb:106:insave’
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/
connection_adapters/abstract/database_statements.rb:66:in
transaction' /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/ transactions.rb:79:intransaction’
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/
transactions.rb:98:in transaction' /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/ transactions.rb:106:insave’
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/
transactions.rb:118:in rollback_active_record_state!' /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/ transactions.rb:106:insave’
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/
base.rb:644:in `create’
./spec/models/task_template_spec.rb:17:

It seems to be trying to set the version_column value. I checked and
the parts table (and all of the other versioned models) does have the
version field present. The part_versions table is also present. What
am I missing?


#2

The acts_as_versioned plugin is not compatible with rails 2.1 as I
understand. You should look at version_fu…

http://github.com/jmckible/version_fu/tree/master


#3

Really? We use acts_as_versioned with Rails 2.1 in Kete (
http://kete.net.nz/). We may have done some slight hacking, but
shouldn’t
be too bad.
You can see our version here:

http://github.com/kete/kete/tree/master/vendor/plugins/acts_as_versioned

You can see from
http://github.com/kete/kete/tree/master/vendor/plugins/acts_as_versioned/.piston.ymlthat
it is based on
git://github.com/technoweenie/acts_as_versioned.git. We possibly
included
some hacks on top of the stuff from that repository in our local
version.

Cheers,
Walter