Skip to content

Commit 283ce0a

Browse files
committed
Whitespace fixes
1 parent e528137 commit 283ce0a

File tree

10 files changed

+1
-42
lines changed

10 files changed

+1
-42
lines changed

elasticsearch-model/lib/elasticsearch/model/adapters/default.rb

-4
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
1818
module Elasticsearch
1919
module Model
2020
module Adapter
21-
2221
# The default adapter for models which haven't one registered
2322
#
2423
module Default
25-
2624
# Module for implementing methods and logic related to fetching records from the database
2725
#
2826
module Records
29-
3027
# Return the collection of records fetched from the database
3128
#
3229
# By default uses `MyModel#find[1, 2, 3]`
@@ -60,7 +57,6 @@ def __transform
6057
raise NotImplemented, "Method not implemented for default adapter"
6158
end
6259
end
63-
6460
end
6561
end
6662
end

elasticsearch-model/lib/elasticsearch/model/adapters/multiple.rb

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
module Elasticsearch
1919
module Model
2020
module Adapter
21-
2221
# An adapter to be used for deserializing results from multiple models,
2322
# retrieved through `Elasticsearch::Model.search`
2423
#

elasticsearch-model/lib/elasticsearch/model/importing.rb

-3
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,8 @@ def import(options={}, &block)
158158
index: target_index,
159159
body: __batch_to_bulk(batch, transform)
160160
}
161-
162161
params[:pipeline] = pipeline if pipeline
163-
164162
response = client.bulk params
165-
166163
yield response if block_given?
167164

168165
errors += response['items'].select { |k, v| k.values.first['error'] }

elasticsearch-model/lib/elasticsearch/model/indexing.rb

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def as_json(options={})
9797
end
9898

9999
module ClassMethods
100-
101100
# Defines mappings for the index
102101
#
103102
# @example Define mapping for model

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

+1-15
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
end
7777

7878
describe 'indexing a document' do
79-
8079
let(:search_result) do
8180
Article.search('title:test')
8281
end
@@ -88,7 +87,6 @@
8887
end
8988

9089
describe '#results' do
91-
9290
let(:search_result) do
9391
Article.search('title:test')
9492
end
@@ -97,12 +95,11 @@
9795
expect(search_result.results.first).to be_a(Elasticsearch::Model::Response::Result)
9896
end
9997

100-
it 'prooperly loads the document' do
98+
it 'properly loads the document' do
10199
expect(search_result.results.first.title).to eq('Test')
102100
end
103101

104102
context 'when the result contains other data' do
105-
106103
let(:search_result) do
107104
Article.search(query: { match: { title: 'test' } }, highlight: { fields: { title: {} } })
108105
end
@@ -119,7 +116,6 @@
119116
end
120117

121118
describe '#records' do
122-
123119
let(:search_result) do
124120
Article.search('title:test')
125121
end
@@ -134,7 +130,6 @@
134130
end
135131

136132
describe 'Enumerable' do
137-
138133
let(:search_result) do
139134
Article.search('title:test')
140135
end
@@ -149,7 +144,6 @@
149144
end
150145

151146
describe '#id' do
152-
153147
let(:search_result) do
154148
Article.search('title:test')
155149
end
@@ -173,7 +167,6 @@
173167
end
174168

175169
describe 'search results order' do
176-
177170
let(:search_result) do
178171
Article.search(query: { match: { title: 'code' }}, sort: { clicks: :desc })
179172
end
@@ -196,7 +189,6 @@
196189
end
197190

198191
describe 'a paged collection' do
199-
200192
let(:search_result) do
201193
Article.search(query: { match: { title: { query: 'test' } } },
202194
size: 2,
@@ -212,7 +204,6 @@
212204
end
213205

214206
describe '#destroy' do
215-
216207
before do
217208
Article.create!(title: 'destroy', body: '', clicks: 1)
218209
Article.__elasticsearch__.refresh_index!
@@ -233,7 +224,6 @@
233224
end
234225

235226
describe 'full document updates' do
236-
237227
before do
238228
article = Article.create!(title: 'update', body: '', clicks: 1)
239229
Article.__elasticsearch__.refresh_index!
@@ -254,7 +244,6 @@
254244
end
255245

256246
describe 'attribute updates' do
257-
258247
before do
259248
article = Article.create!(title: 'update', body: '', clicks: 1)
260249
Article.__elasticsearch__.refresh_index!
@@ -275,7 +264,6 @@
275264
end
276265

277266
describe '#save' do
278-
279267
before do
280268
article = Article.create!(title: 'save', body: '', clicks: 1)
281269

@@ -302,7 +290,6 @@
302290
end
303291

304292
describe 'a DSL search' do
305-
306293
let(:search_result) do
307294
Article.search(query: { match: { title: { query: 'test' } } })
308295
end
@@ -314,7 +301,6 @@
314301
end
315302

316303
describe 'chaining SQL queries on response.records' do
317-
318304
let(:search_result) do
319305
Article.search(query: { match: { title: { query: 'test' } } })
320306
end

elasticsearch-model/spec/elasticsearch/model/adapters/active_record/pagination_spec.rb

-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
require 'spec_helper'
1919

2020
describe 'Elasticsearch::Model::Adapter::ActiveRecord Pagination' do
21-
2221
before(:all) do
2322
ActiveRecord::Schema.define(:version => 1) do
2423
create_table ArticleForPagination.table_name do |t|
@@ -41,48 +40,41 @@
4140
end
4241

4342
context 'when no other page is specified' do
44-
4543
let(:records) do
4644
ArticleForPagination.search('title:test').page(1).records
4745
end
4846

4947
describe '#size' do
50-
5148
it 'returns the correct size' do
5249
expect(records.size).to eq(25)
5350
end
5451
end
5552

5653
describe '#current_page' do
57-
5854
it 'returns the correct current page' do
5955
expect(records.current_page).to eq(1)
6056
end
6157
end
6258

6359
describe '#prev_page' do
64-
6560
it 'returns the correct previous page' do
6661
expect(records.prev_page).to be_nil
6762
end
6863
end
6964

7065
describe '#next_page' do
71-
7266
it 'returns the correct next page' do
7367
expect(records.next_page).to eq(2)
7468
end
7569
end
7670

7771
describe '#total_pages' do
78-
7972
it 'returns the correct total pages' do
8073
expect(records.total_pages).to eq(3)
8174
end
8275
end
8376

8477
describe '#first_page?' do
85-
8678
it 'returns the correct first page' do
8779
expect(records.first_page?).to be(true)
8880
end

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

-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
end
5454

5555
describe 'has_child search' do
56-
5756
let(:search_result) do
5857
Question.search(query: { has_child: { type: 'answer', query: { match: { author: 'john' } } } })
5958
end
@@ -64,7 +63,6 @@
6463
end
6564

6665
describe 'hash_parent search' do
67-
6866
let(:search_result) do
6967
Answer.search(query: { has_parent: { parent_type: 'question', query: { match: { author: 'john' } } } })
7068
end
@@ -75,7 +73,6 @@
7573
end
7674

7775
context 'when a parent is deleted' do
78-
7976
before do
8077
Question.where(title: 'First Question').each(&:destroy)
8178
Question.__elasticsearch__.refresh_index!

elasticsearch-model/spec/elasticsearch/model/adapters/active_record/serialization_spec.rb

-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
require 'spec_helper'
1919

2020
describe 'Elasticsearch::Model::Adapter::ActiveRecord Serialization' do
21-
2221
before(:all) do
2322
ActiveRecord::Schema.define(:version => 1) do
2423
create_table ArticleWithCustomSerialization.table_name do |t|
@@ -32,14 +31,12 @@
3231
end
3332

3433
context 'when the model has a custom serialization defined' do
35-
3634
before do
3735
ArticleWithCustomSerialization.create!(title: 'Test', status: 'green')
3836
ArticleWithCustomSerialization.__elasticsearch__.refresh_index!
3937
end
4038

4139
context 'when a document is indexed' do
42-
4340
let(:search_result) do
4441
ArticleWithCustomSerialization.__elasticsearch__.client.get(
4542
index: 'article_with_custom_serializations',
@@ -53,7 +50,6 @@
5350
end
5451

5552
context 'when a document is updated' do
56-
5753
before do
5854
article.update(title: 'UPDATED', status: 'yellow')
5955
ArticleWithCustomSerialization.__elasticsearch__.refresh_index!

elasticsearch-model/spec/elasticsearch/model/multimodel_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444
end
4545

4646
describe 'the model registry' do
47-
4847
before(:all) do
49-
5048
class JustAModel
5149
include Elasticsearch::Model
5250
end

elasticsearch-model/spec/elasticsearch/model/proxy_spec.rb

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
require 'spec_helper'
1919

2020
describe Elasticsearch::Model::Proxy do
21-
2221
before(:all) do
2322
class ::DummyProxyModel
2423
include Elasticsearch::Model::Proxy

0 commit comments

Comments
 (0)