Removing database.yml when using Mongoid in Rails 3.2

后端 未结 2 1268
梦如初夏
梦如初夏 2020-12-09 18:28

I just began a new rails project and wanted to use MongoidDB thru the Mongoid gem. Following the instructions on the Mongoid site, I added the following lines to my G

相关标签:
2条回答
  • 2020-12-09 18:58

    Maybe comment this two lines

    config/environments/development.rb:  
    
    # config.active_record.mass_assignment_sanitizer = :strict
    # config.active_record.auto_explain_threshold_in_seconds = 0.5
    
    0 讨论(0)
  • 2020-12-09 19:03

    You're probably setting some config.active_record settings somewhere in your config folder (development.rb, test.rb, etc). You'll want to comment out these settings since you're not using ActiveRecord.

    You can do something like grep -r active_record config/ in your project folder to find files referencing active_record.

    Update: Make sure you have removed the require 'rails/all' line from config/application.rb as well. The new require lines you added are supposed to replace that line. Otherwise, rails/all still loads ActiveRecord.

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