Forum: Ruby on Rails Version fu problem

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.
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2009-03-26 04:34
(Received via mailing list)
Hi,

I have a class that uses version_fu (Page class) the issue is that if
I run a clean migration it fails on the version_fu declaration in the
Page class, Its looking for the page_versions column that has not been
created yet.

Anyone seen this before?

Looks like if I do

version_fu rescue nil

The error does not show and my migration runs all the way to the
end... isn't that just ugly?
4375b4aca04b8d72482fd409fb6d0b47?d=identicon&s=25 Roderick van Domburg (roderickvd)
on 2009-03-26 17:16
Freddy Andersen wrote:
> I have a class that uses version_fu (Page class) the issue is that if
> I run a clean migration it fails on the version_fu declaration in the
> Page class, Its looking for the page_versions column that has not been
> created yet.

For this reason you should use rake db:schema:load instead of
db:migrate.
Otherwise, you'll have to come up with ugly tricks.

--
Roderick van Domburg
http://www.nedforce.com
This topic is locked and can not be replied to.