Forum: Ruby on Rails First time plugin user: Problem with "acts_as_versioned"

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.
3504745159d79c585e4f7df8df76aa10?d=identicon&s=25 Ingo Weiss (ingoweiss)
on 2006-06-03 14:38
Hi,

I am having trouble with using the acts_as_versioned plugin. I installed
the plugin, and ran the migration. acts_as_versioned created the
versioned table OK, but when I try to use it I get an error. Here is
some console output:


>> m = Mymodel.find(:first)
NameError: undefined local variable or method `acts_as_versioned' for
Mymodel:Class


Did I miss a step?

Ingo
3504745159d79c585e4f7df8df76aa10?d=identicon&s=25 Ingo Weiss (ingoweiss)
on 2006-06-03 14:47
Hi,

I found out what the problem was. I alread had a bunch of rows for the
model that I wanted to become versioned in the database. Apparently
acts_as_versioned doesn't automatically convert existing rows (i.e. set
the version number to 1 and make a copy in the versioned table) which,
btw, would be a polite thing to do wouldn't it? But it works fine for
new rows.

Ingo




Ingo Weiss wrote:
> Hi,
>
> I am having trouble with using the acts_as_versioned plugin. I installed
> the plugin, and ran the migration. acts_as_versioned created the
> versioned table OK, but when I try to use it I get an error. Here is
> some console output:
>
>
>>> m = Mymodel.find(:first)
> NameError: undefined local variable or method `acts_as_versioned' for
> Mymodel:Class
>
>
> Did I miss a step?
>
> Ingo
This topic is locked and can not be replied to.