Rails 4: Use MySql and MongoDB together

后端 未结 1 728
慢半拍i
慢半拍i 2021-02-11 07:43

I\'m trying to make an application in rails 4 using MongoDB(mongoid) and MySQL together. But I\'m not able to set it up.

I\'m following the steps below:

1条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-11 08:09

    add these line to your application.rb file:
    config.generators do |g| g.orm :active_record end

    This will force rails g to use active record.

    And whenever you want to generate a model for mongodb, use:
    rails g mongoid:model yourmodelname

    0 讨论(0)
提交回复
热议问题