All threads / How to use Multiple Databases in Rails 6.0 Discussion

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to use Multiple Databases in Rails 6.0 Discussion

Hi. I am trying to use Rails 6's automatic read/write splitting with the multiple databases feature. There seems to be a problem with Devise, because the automatic connection switching sends writes to the master for POST/PUT/DELETE requests and reads to the replicas for GET requests. However Devise makes changes/writes to the database even with GET requests sometimes (for example to confirm a user upon sign up using a token in the link in the confirmation email), so these changes are basically blocked by Rails. Does anyone have any idea for a workaround? I've opened a Github issue about it: https://github.com/plataformatec/devise/issues/5133

Thanks!

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,344+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.