How do I remove ActiveRecord from an existing Rails 4 Application?

橙三吉。 提交于 2019-11-30 15:55:30
Rajdeep Singh

Follow these steps

  1. Remove database adapter gems from your Gemfile, e.g., mysql2, sqlite3, etc

  2. From application.rb, remove require 'rails/all' and add

    require "action_controller/railtie"
    require "action_mailer/railtie"
    require "sprockets/railtie"
    require "rails/test_unit/railtie"
    
  3. Delete database.yml, schema.rb and all the migrations

  4. Delete migration checks from test/test_helper.rb
  5. Delete all activerecord related configuration from config/environments

Hope this helps!

Source - Disable ActiveRecord for Rails 4

For those using the rails-api gem you may encounter a similar error when using the --skip-active-record flag when doing rails-api new my_api. The current fix (until a new corrected version of the gem is released) is to edit your rails-api gem to have this commit. Use bundle open and replace the old Gemfile with the new corrected one. Rerun and you should be all set.

For the second part of the question: I can recommend to use https://github.com/neo4jrb/devise-neo4j for the authentication system.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!