Mongodb, mongoid Rails 3.1. * Error with active recording

3-4 months later, when I returned to another project on RoR, with Mongoid. I am stuck in a strange problem. Since I followed the Mongoid. generated mongoid.yml , remote database.yml . and changed

 #require 'rails/all' require "action_controller/railtie" require "action_mailer/railtie" require "active_resource/railtie" require "rails/test_unit/railtie" require "sprockets/railtie" # Uncomment this line for Rails 3.1+ 

in config/application.rb .

I am still facing this problem. s starting from the server.

 configuration.rb:85:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x9441fd4> (NoMethodError) 

Unfortunately, I had to comment on config.active_record.mass_assignment_sanitizer = :strict and
config.active_record.auto_explain_threshold_in_seconds = 0.5 in config/environments/development.rb .

+6
source share
1 answer

Comment on the following lines

 config.active_record.mass_assignment_sanitizer = :strict config.active_record.auto_explain_threshold_in_seconds = 0.5 

in config / environment / development.rb and config / environment / test.rb

+9
source

Source: https://habr.com/ru/post/909340/


All Articles