I have both ActiveRecord (MySQL) and Mongoid in my Rails 3.1 application. Everything is fine, excepts all generators uses mongoid to generate models. This way, when i:
rails g model user
i receive mongoid-like model, but i need ActiveRecord structure and migrations.
How can i switch back to AR?
Mongoid overrides the model generator, but you can switch it back.
In config/application.rb you can either add a line if you've already got a block similar to this:
config.generators do |g|
g.template_engine :haml
...
g.orm :active_record
end
Or just simply add the entire config line directly to the file
config.generators.orm :active_record
You can also pass :migrations => false if you want to turn off migrations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With