开发者

Problem switching from DataMapper to Active Record in Rails 3

开发者 https://www.devze.com 2023-01-31 17:23 出处:网络
I have removed my DataMapper specific models and gems in my Rakefile and removed开发者_C百科 all databases. I also updated my database.yml file. Now, when I attempt to generate a model with

I have removed my DataMapper specific models and gems in my Rakefile and removed开发者_C百科 all databases. I also updated my database.yml file. Now, when I attempt to generate a model with

rails g model Car year:integer make:string model:string

I get:

No value provided for required options '--orm'

Is there someplace that I am missing the specification of Active Record? I've been unable to find any documentation for switching an application's ORM.


Have a look in config/application.rb, you may have a line that looks like this:

config.generators do |g|
  g.orm :datamapper
end

Change that :datamapper symbol to :active_record or remove that line completely to switch back to ActiveRecord.

If it's not there, you may have a file in config/initializers which does this setup for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号