Connect to different database?
bobdutch opened this issue · comments
Bob Dutcheshen commented
I'm using a Rails app with multiple databases. The Rollup class in the gem inherits from ActiveRecord::Base so it uses the primary database connection. Is there a way I can change the database connection or superclass for the model? If not I think it would be a good feature. Thanks.
Andrew Kane commented
Hey @bobdutch, you should be able to create an initializer with:
Rollup.establish_connection(:otherdb)
Bob Dutcheshen commented
That's perfect. Thank you!
Duda Dornelles commented
Could it read from one db but write on another? Thinking replica for reads primary for writes
Andrew Kane commented
Hey @dudadornelles, please create a new issue for this.