Skip to content

Commit ebf8442

Browse files
Remove deprecated include_type_name parameter
1 parent bdb6a38 commit ebf8442

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

opensearch-model/spec/opensearch/model/adapters/active_record/basic_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
end
6868

6969
Article.delete_all
70-
Article.__opensearch__.create_index!(force: true, include_type_name: true)
70+
Article.__opensearch__.create_index!(force: true)
7171

7272
Article.create!(title: 'Test', body: '', clicks: 1)
7373
Article.create!(title: 'Testing Coding', body: '', clicks: 2)

opensearch-model/spec/opensearch/model/adapters/active_record/namespaced_model_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
end
2828

2929
MyNamespace::Book.delete_all
30-
MyNamespace::Book.__opensearch__.create_index!(force: true, include_type_name: true)
30+
MyNamespace::Book.__opensearch__.create_index!(force: true)
3131
MyNamespace::Book.create!(title: 'Test')
3232
MyNamespace::Book.__opensearch__.refresh_index!
3333
end

opensearch-model/spec/opensearch/model/adapters/active_record/parent_child_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
add_index(:answers, :question_id) unless index_exists?(:answers, :question_id)
3939

4040
clear_tables(Question)
41-
ParentChildSearchable.create_index!(force: true, include_type_name: true)
41+
ParentChildSearchable.create_index!(force: true)
4242

4343
q_1 = Question.create!(title: 'First Question', author: 'John')
4444
q_2 = Question.create!(title: 'Second Question', author: 'Jody')

opensearch-model/spec/opensearch/model/indexing_spec.rb

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,6 @@ class NotFound < Exception; end
131131
it 'uses text as the default field type' do
132132
expect(mappings.to_hash[:mytype][:properties][:bar][:type]).to eq('text')
133133
end
134-
135-
context 'when the \'include_type_name\' option is specified' do
136-
137-
let(:mappings) do
138-
OpenSearch::Model::Indexing::Mappings.new(:mytype, include_type_name: true)
139-
end
140-
141-
before do
142-
mappings.indexes :foo, { type: 'boolean', include_in_all: false }
143-
end
144-
145-
it 'creates the correct mapping definition' do
146-
expect(mappings.to_hash[:mytype][:properties][:foo][:type]).to eq('boolean')
147-
end
148-
149-
it 'sets the \'include_type_name\' option' do
150-
expect(mappings.to_hash[:mytype][:include_type_name]).to eq(true)
151-
end
152-
end
153134
end
154135

155136
context 'when a type is not specified' do
@@ -173,9 +154,8 @@ class NotFound < Exception; end
173154
end
174155

175156
context 'when specific mappings are defined' do
176-
177157
let(:mappings) do
178-
OpenSearch::Model::Indexing::Mappings.new(:mytype, include_type_name: true)
158+
OpenSearch::Model::Indexing::Mappings.new(:mytype)
179159
end
180160

181161
before do
@@ -243,10 +223,6 @@ class NotFound < Exception; end
243223
expect(mappings.to_hash[:mytype][:properties][:foo_nested_as_symbol][:properties]).not_to be_nil
244224
expect(mappings.to_hash[:mytype][:properties][:foo_nested_as_symbol][:fields]).to be_nil
245225
end
246-
247-
it 'defines the settings' do
248-
expect(mappings.to_hash[:mytype][:include_type_name]).to be(true)
249-
end
250226
end
251227
end
252228

0 commit comments

Comments
 (0)