Skip to content

Commit 5536973

Browse files
committed
[STORE] Ensure that arguments are passed to super (elastic#853)
1 parent 3f2c03f commit 5536973

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

elasticsearch-persistence/lib/elasticsearch/persistence/repository.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ def settings(*args)
211211
#
212212
# @since 6.0.0
213213
def index_exists?(*args)
214-
super(index_name: index_name)
214+
params = { index_name: index_name }
215+
params.merge!(args.first) unless args.empty?
216+
super(params)
215217
end
216218

217219
# Get the nicer formatted string for use in inspection.

elasticsearch-persistence/spec/repository_spec.rb

+7
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,13 @@ class RepositoryWithDSL
353353
it 'determines if the index exists' do
354354
expect(repository.index_exists?).to be(true)
355355
end
356+
357+
context 'when arguments are passed in' do
358+
359+
it 'passes the arguments to the request' do
360+
expect(repository.index_exists?(index: 'other')).to be(false)
361+
end
362+
end
356363
end
357364

358365
context 'when the method is called on the class' do

0 commit comments

Comments
 (0)