erpuds
erpuds

Reputation: 11

Problem switching from DataMapper to Active Record in Rails 3

I have removed my DataMapper specific models and gems in my Rakefile and removed 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.

Upvotes: 0

Views: 462

Answers (1)

Ryan Bigg
Ryan Bigg

Reputation: 107728

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.

Upvotes: 1

Related Questions