How to skip active record for existing project in Rails 6

后端 未结 1 1130
悲&欢浪女
悲&欢浪女 2021-01-27 10:16

I have an existing Rails project which I created in API mode, using no DB. Upon trying to deploy to Heroku, I am getting lots of ActiveRecord related errors.

--         


        
相关标签:
1条回答
  • 2021-01-27 10:33

    To replicate the skip-active-record setup in an existing project, follow the steps in this answer

    PLUS

    REMOVE config/environments/development.rb -> config.active_storage.service = :local

    REMOVE config/environments/production.rb -> config.active_storage.service = :local

    REMOVE config/environments/test.rb -> config.active_storage.service = :local

    REMOVE bin/setup -> puts "\n== Preparing database ==" system! 'bin/rails db:prepare'

    DELETE config/storage.yml

    REMOVE test/test_helper.rb # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all

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