Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple redis connections #49

Merged

Conversation

SxDx
Copy link
Contributor

@SxDx SxDx commented Jan 30, 2024

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.

@SxDx SxDx mentioned this pull request Jan 30, 2024
@SxDx
Copy link
Contributor Author

SxDx commented Feb 20, 2024

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?

lib/modis.rb Outdated Show resolved Hide resolved
@otherguy
Copy link

Hey @benlangfeld! Great that you picked this up :) Is there anything we can do to help get this merged?

benlangfeld pushed a commit that referenced this pull request Jul 31, 2024
While working on a new feature for modis (#49) I noticed that calling
`deprecate` without passing in a deprecator instance is deprecated.
Thought I would address this apart from the larger feature PR.
@benlangfeld benlangfeld merged commit 7967970 into rpush:master Jul 31, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants