Skip to content

Commit eb868df

Browse files
Benjamin KrauseBenjamin Krause
authored andcommitted
fixed with_configuration to get rid of old configurations before yielding
1 parent 37a1196 commit eb868df

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/sunspot/rails/configuration.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ def master_path
115115
# Boolean:: bool
116116
#
117117
def has_master?
118-
unless defined?(@has_master)
119-
@has_master = !!user_configuration_from_key('master_solr')
120-
end
121-
@has_master
118+
@has_master = !!user_configuration_from_key('master_solr')
122119
end
123120

124121
#

spec/session_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
def with_configuration(options)
3232
original_configuration = Sunspot::Rails.configuration
33+
Sunspot::Rails.reset
3334
Sunspot::Rails.configuration = Sunspot::Rails::Configuration.new
3435
Sunspot::Rails.configuration.user_configuration = options
3536
yield

0 commit comments

Comments
 (0)