Skip to content

Commit 23b2a4c

Browse files
committed
standard: Layout/EmptyLinesAfterModuleInclusion
1 parent 23641c2 commit 23b2a4c

11 files changed

Lines changed: 40 additions & 0 deletions

File tree

lib/pg_search/model.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def pg_search_scope(name, options)
2323

2424
def multisearchable(options = {})
2525
include PgSearch::Multisearchable
26+
2627
class_attribute :pg_search_multisearchable_options
2728
self.pg_search_multisearchable_options = options
2829
end

lib/pg_search/scope_options.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module WithPgSearchHighlight
2727
def self.[](tsearch)
2828
Module.new do
2929
include WithPgSearchHighlight
30+
3031
define_method(:tsearch) { tsearch }
3132
end
3233
end

spec/integration/associations_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
model do
2222
include PgSearch::Model
23+
2324
belongs_to :another_model, class_name: "AssociatedModel"
2425

2526
pg_search_scope :with_another, associated_against: {another_model: :title}
@@ -57,6 +58,7 @@
5758

5859
model do
5960
include PgSearch::Model
61+
6062
belongs_to :another_model, class_name: "AssociatedModel"
6163

6264
pg_search_scope :with_associated, against: :title, associated_against: {another_model: :title}
@@ -93,6 +95,7 @@
9395

9496
model do
9597
include PgSearch::Model
98+
9699
has_many :other_models, class_name: "AssociatedModelWithHasMany", foreign_key: "ModelWithHasMany_id"
97100

98101
pg_search_scope :with_associated, against: [:title], associated_against: {other_models: :title}
@@ -284,6 +287,7 @@
284287

285288
model do
286289
include PgSearch::Model
290+
287291
belongs_to :another_model, class_name: "AssociatedModel"
288292

289293
pg_search_scope :with_associated, associated_against: {another_model: %i[title author]}
@@ -337,6 +341,7 @@
337341

338342
model do
339343
include PgSearch::Model
344+
340345
belongs_to :another_model, class_name: "AssociatedModel"
341346

342347
pg_search_scope :with_associated, associated_against: {another_model: :number}
@@ -368,6 +373,7 @@
368373
model do
369374
has_many :children
370375
include PgSearch::Model
376+
371377
pg_search_scope :search_name, against: :name
372378
end
373379
end
@@ -411,6 +417,7 @@
411417

412418
model do
413419
include PgSearch::Model
420+
414421
belongs_to :model_with_association
415422

416423
pg_search_scope :search_content, against: :content
@@ -457,6 +464,7 @@
457464

458465
model do
459466
include PgSearch::Model
467+
460468
pg_search_scope :search, against: :title, using: %i[tsearch trigram]
461469
end
462470
end

spec/integration/pagination_spec.rb

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

1212
model do
1313
include PgSearch::Model
14+
1415
pg_search_scope :search_name, against: :name
1516

1617
def self.page(page_number)

spec/integration/pg_search_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
model do
1616
include PgSearch::Model
17+
1718
belongs_to :parent_model
1819
end
1920
end
@@ -24,6 +25,7 @@
2425

2526
model do
2627
include PgSearch::Model
28+
2729
has_many :models_with_pg_search
2830
scope :active, -> { where(active: true) }
2931
end
@@ -238,6 +240,7 @@
238240

239241
model do
240242
include PgSearch::Model
243+
241244
belongs_to :person
242245
pg_search_scope :search_city, against: [:city]
243246
end
@@ -250,6 +253,7 @@
250253

251254
model do
252255
include PgSearch::Model
256+
253257
has_many :houses
254258
pg_search_scope :named, against: [:name]
255259
scope :with_house_in_city, lambda { |city|
@@ -1046,6 +1050,7 @@
10461050

10471051
model do
10481052
include PgSearch::Model
1053+
10491054
has_many :comments
10501055
end
10511056
end

spec/integration/single_table_inheritance_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
model do
1414
include PgSearch::Model
15+
1516
pg_search_scope :search_content, against: :content
1617
end
1718
end
@@ -52,6 +53,7 @@
5253

5354
model do
5455
include PgSearch::Model
56+
5557
self.inheritance_column = "custom_type"
5658
pg_search_scope :search_content, against: :content
5759
end

spec/lib/pg_search/configuration/association_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
model do
2121
include PgSearch::Model
22+
2223
has_one :avatar, class_name: "Avatar"
2324
belongs_to :site
2425

@@ -34,6 +35,7 @@
3435

3536
model do
3637
include PgSearch::Model
38+
3739
has_many :users, class_name: "User"
3840

3941
pg_search_scope :with_users, associated_against: {users: :name}

spec/lib/pg_search/configuration/foreign_column_spec.rb

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

1919
model do
2020
include PgSearch::Model
21+
2122
belongs_to :another_model, class_name: "AssociatedModel"
2223

2324
pg_search_scope :with_another, associated_against: {another_model: :title}

spec/lib/pg_search/multisearch/rebuilder_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
with_model :Model do
2626
model do
2727
include PgSearch::Model
28+
2829
multisearchable
2930

3031
def rebuild_pg_search_documents
@@ -53,6 +54,7 @@ def rebuild_pg_search_documents
5354

5455
model do
5556
include PgSearch::Model
57+
5658
multisearchable conditional_key => :active?
5759

5860
def rebuild_pg_search_documents
@@ -84,6 +86,7 @@ def rebuild_pg_search_documents
8486

8587
model do
8688
include PgSearch::Model
89+
8790
multisearchable against: :name
8891
end
8992
end
@@ -147,6 +150,7 @@ def rebuild_pg_search_documents
147150

148151
model do
149152
include PgSearch::Model
153+
150154
multisearchable against: :name
151155
end
152156
end
@@ -166,6 +170,7 @@ def rebuild_pg_search_documents
166170

167171
model do
168172
include PgSearch::Model
173+
169174
multisearchable against: :name
170175
end
171176
end
@@ -207,6 +212,7 @@ def rebuild_pg_search_documents
207212
with_model :Model do
208213
model do
209214
include PgSearch::Model
215+
210216
multisearchable against: [:foo]
211217

212218
def foo
@@ -252,6 +258,7 @@ def foo
252258

253259
model do
254260
include PgSearch::Model
261+
255262
multisearchable against: :name,
256263
additional_attributes: ->(obj) { {additional_attribute_column: "#{obj.class}::#{obj.id}"} }
257264
end
@@ -281,6 +288,7 @@ def foo
281288

282289
model do
283290
include PgSearch::Model
291+
284292
multisearchable if: :active?
285293
end
286294
end
@@ -322,6 +330,7 @@ def foo
322330

323331
model do
324332
include PgSearch::Model
333+
325334
multisearchable unless: :inactive?
326335
end
327336
end

spec/lib/pg_search/multisearchable_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
with_model :ModelThatIsMultisearchable do
1111
model do
1212
include PgSearch::Model
13+
1314
multisearchable
1415
end
1516
end
@@ -21,6 +22,7 @@
2122

2223
model do
2324
include PgSearch::Model
25+
2426
multisearchable
2527

2628
has_many :multisearchable_children, dependent: :destroy
@@ -319,6 +321,7 @@
319321

320322
model do
321323
include PgSearch::Model
324+
322325
multisearchable if: ->(record) { record.multisearchable? }
323326
end
324327
end
@@ -450,6 +453,7 @@
450453

451454
model do
452455
include PgSearch::Model
456+
453457
multisearchable unless: ->(record) { record.not_multisearchable? }
454458
end
455459
end
@@ -585,6 +589,7 @@
585589

586590
model do
587591
include PgSearch::Model
592+
588593
multisearchable if: :multisearchable?
589594
end
590595
end
@@ -723,6 +728,7 @@
723728

724729
model do
725730
include PgSearch::Model
731+
726732
multisearchable unless: :not_multisearchable?
727733
end
728734
end

0 commit comments

Comments
 (0)