modis
modis copied to clipboard
Add support for multiple redis connections
This PR adds support for more than one redis connection by providing multiple configurations to redis_options like this:
Modis.redis_options = {
default: { url: 'redis://localhost:6379/0' },
custom: { url: 'redis://localhost:6379/1' }
}
while still being backwards compatible to the old configuration style
Modis.redis_options = {
url: 'redis://localhost:6379/0
}
You can then select which connection to use on a per model basis
class User
include Modis::Model
self.modis_connection = :custom
attribute :name, :string
end
If you have any ideas on how to improve the tests I am more than happy to change them.
Hey @ileitch and @aried3r 👋 , We would really love this feature for our app. Is there a chance that you could take a look at this, or should we look at forking the project?
Hey @benlangfeld! Great that you picked this up :) Is there anything we can do to help get this merged?