Forum: Ruby on Rails acts_as_versioned issues

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fcb0d02b7a4c78cb716a32d7ca5f2acc?d=identicon&s=25 Bob Aman (Guest)
on 2008-10-17 10:02
(Received via mailing list)
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:in `method_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:in
`save_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:in `evaluate_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:in `run'
/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:in `send'
/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:in `run_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:in `create_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:in `save_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:in `save'
/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:in `transaction'
/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:in `save'
/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:in `save'
/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?
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2008-10-17 13:13
(Received via mailing list)
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
A39970d780c506b26e9a8b71eda13df2?d=identicon&s=25 Walter McGinnis (Guest)
on 2008-10-17 21:05
(Received via mailing list)
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/plu...

You can see from
http://github.com/kete/kete/tree/master/vendor/plu...
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
This topic is locked and can not be replied to.