Using Active Record generators after Mongoid installation?

Ruby on-RailsActiverecordMongoidMongodb

Ruby on-Rails Problem Overview


I'm using MongoDB via Mongoid integration, as well as ActiveRecord in a project. I would like to generate migrations for active record, and Mongoid is the default when I run.

rails g migration

Any ideas how to specify AR as my default generator for migrations, models, etc?

Thanks!

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

rails g active_record:migration 

Solution 2 - Ruby on-Rails

You can config to use ActiveRecord generators in your config/application.rb

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAllyl IsocyanateView Question on Stackoverflow
Solution 1 - Ruby on-RailsAllyl IsocyanateView Answer on Stackoverflow
Solution 2 - Ruby on-Railsdima TiView Answer on Stackoverflow