kenn / standby

Read from standby databases for ActiveRecord
MIT License
87 stars 28 forks source link

Allow url formatted db connections. #10

Closed citrus closed 7 years ago

citrus commented 7 years ago

I had trouble using a database URL in my database.yml

development:
  adapter: postgresql
  database: master-db

development_slave: <%= ENV['READONLY_DATABASE_URL'] %>

This patch allows the connection to be activated using URL or hash syntax.

kenn commented 7 years ago

Awesome, thank you!

Is it possible to add a test case for this? Because even though your code is clean and I like it, the intention for this change is less clear and it can break again.

citrus commented 7 years ago

Sure thing, will do!

kenn commented 7 years ago

Thank you! 🎉 🎉 🎉