Forum: Ruby on Rails Can't use models in migrations

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6cf8286fcab5843f468d62f5e6fb22de?d=identicon&s=25 Henry Turner (Guest)
on 2007-03-25 22:38
(Received via mailing list)
Hi there,

This always used to work for me... but not now. I want to blame Rails
1.2 but I'm sure its not.

I can't use AR models in my migrations. To make sure its not just my
dodgy code I tried to do the same with a well known plugin..

A migration such as the one below (taken from acts_as_versioned) is
giving the error
undefined method `create_versioned_table' for

What the hell is that about? create_versioned_table is a definition of
Post.. not bloody SqlAdapter whatever.



        #   class AddVersions < ActiveRecord::Migration
        #     def self.up
        #       # create_versioned_table takes the same options hash
        #       # that create_table does
        #       Post.create_versioned_table
        #     end
        #     def self.down
        #       Post.drop_versioned_table
        #     end
        #   end
6cf8286fcab5843f468d62f5e6fb22de?d=identicon&s=25 (Guest)
on 2007-03-26 20:05
(Received via mailing list)
Hmmm, as expected I was at fault..

I was giving my migrations the same class names as their respective
models... madness.


On Mar 25, 9:37 pm, "Henry Turner" <>
This topic is locked and can not be replied to.