Skip to content

Commit

Permalink
Restore backwards compatibility broken in 4.3.0
Browse files Browse the repository at this point in the history
Fixes #50
  • Loading branch information
benlangfeld committed Aug 1, 2024
1 parent 4e96170 commit 7721346
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/modis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ def redis_options=(options)
if options.is_a?(Hash) && options.values.first.is_a?(Hash)
@redis_options = options.transform_values(&:dup)
else
@redis_options[:default] = options
redis_options[:default] = options
end
end

def reset!
instance_variables.each do |var|
instance_variable_set(var, nil)
remove_instance_variable(var)
end
end

Expand Down
2 changes: 2 additions & 0 deletions spec/multi_redis_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'

module MultiRedisSpec
class DefaultUserModel
include Modis::Model
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

RSpec.configure do |config|
config.after :each do
Modis.reset!
RSpec::Mocks.space.proxy_for(Modis).reset
Modis.connection_pools.each do |key, _|
Modis.with_connection(key) do |connection|
Expand Down

0 comments on commit 7721346

Please sign in to comment.