Multiple database connection in Rails

前端 未结 7 1231
说谎
说谎 2020-12-06 07:53

I\'m using active_delegate for multiple connection in Rails. Here I\'m using mysql as master_database for some models,and postgresql for some other models.

Problem i

7条回答
  •  温柔的废话
    2020-12-06 08:09

    Another way:

    class Abc < ActiveRecord::Base
      establish_connection Rails.configuration.database_configuration["test"]
    end
    

提交回复
热议问题