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..
acts_as_versioned.
A migration such as the one below (taken from acts_as_versioned) is
giving the error
undefined method `create_versioned_table'' for
#<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb74a1d44>
What the hell is that about? create_versioned_table is a definition of
Post.. not bloody SqlAdapter whatever.
Ideas?
Thanks
-henry
# 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
henryturnerlists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2007-Mar-26 18:04 UTC
Re: Can''t use models in migrations
Hmmm, as expected I was at fault.. I was giving my migrations the same class names as their respective models... madness. ta -h On Mar 25, 9:37 pm, "Henry Turner" <henryturnerli...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 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.. > acts_as_versioned. > > A migration such as the one below (taken from acts_as_versioned) is > giving the error > undefined method `create_versioned_table'' for > #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb74a1d44> > > What the hell is that about? create_versioned_table is a definition of > Post.. not bloody SqlAdapter whatever. > > Ideas? > > Thanks > -henry > > # 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--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---