pg_search 2.1.2 → 2.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +1 -0
  3. data/.editorconfig +10 -0
  4. data/.github/dependabot.yml +11 -0
  5. data/.github/workflows/ci.yml +75 -0
  6. data/.jrubyrc +1 -0
  7. data/.rubocop.yml +95 -10
  8. data/.travis.yml +26 -48
  9. data/CHANGELOG.md +179 -112
  10. data/CODE_OF_CONDUCT.md +76 -0
  11. data/CONTRIBUTING.md +5 -3
  12. data/Gemfile +6 -4
  13. data/LICENSE +1 -1
  14. data/README.md +307 -198
  15. data/Rakefile +7 -3
  16. data/lib/pg_search/configuration/association.rb +2 -0
  17. data/lib/pg_search/configuration/column.rb +2 -0
  18. data/lib/pg_search/configuration/foreign_column.rb +2 -0
  19. data/lib/pg_search/configuration.rb +20 -6
  20. data/lib/pg_search/document.rb +7 -5
  21. data/lib/pg_search/features/dmetaphone.rb +7 -7
  22. data/lib/pg_search/features/feature.rb +4 -2
  23. data/lib/pg_search/features/trigram.rb +31 -5
  24. data/lib/pg_search/features/tsearch.rb +18 -14
  25. data/lib/pg_search/features.rb +2 -0
  26. data/lib/pg_search/migration/dmetaphone_generator.rb +3 -1
  27. data/lib/pg_search/migration/generator.rb +4 -2
  28. data/lib/pg_search/migration/multisearch_generator.rb +2 -1
  29. data/lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb +6 -6
  30. data/lib/pg_search/migration/templates/create_pg_search_documents.rb.erb +3 -3
  31. data/lib/pg_search/model.rb +57 -0
  32. data/lib/pg_search/multisearch/rebuilder.rb +14 -6
  33. data/lib/pg_search/multisearch.rb +23 -6
  34. data/lib/pg_search/multisearchable.rb +10 -6
  35. data/lib/pg_search/normalizer.rb +2 -0
  36. data/lib/pg_search/railtie.rb +2 -0
  37. data/lib/pg_search/scope_options.rb +26 -49
  38. data/lib/pg_search/tasks.rb +5 -1
  39. data/lib/pg_search/version.rb +3 -1
  40. data/lib/pg_search.rb +17 -55
  41. data/pg_search.gemspec +19 -11
  42. data/spec/.rubocop.yml +2 -2
  43. data/spec/integration/.rubocop.yml +11 -0
  44. data/spec/integration/associations_spec.rb +125 -162
  45. data/spec/integration/deprecation_spec.rb +33 -0
  46. data/spec/integration/pagination_spec.rb +10 -8
  47. data/spec/integration/pg_search_spec.rb +359 -306
  48. data/spec/integration/single_table_inheritance_spec.rb +18 -17
  49. data/spec/lib/pg_search/configuration/association_spec.rb +17 -13
  50. data/spec/lib/pg_search/configuration/column_spec.rb +2 -0
  51. data/spec/lib/pg_search/configuration/foreign_column_spec.rb +6 -4
  52. data/spec/lib/pg_search/features/dmetaphone_spec.rb +6 -4
  53. data/spec/lib/pg_search/features/trigram_spec.rb +51 -20
  54. data/spec/lib/pg_search/features/tsearch_spec.rb +29 -21
  55. data/spec/lib/pg_search/multisearch/rebuilder_spec.rb +151 -85
  56. data/spec/lib/pg_search/multisearch_spec.rb +67 -37
  57. data/spec/lib/pg_search/multisearchable_spec.rb +217 -123
  58. data/spec/lib/pg_search/normalizer_spec.rb +14 -10
  59. data/spec/lib/pg_search_spec.rb +102 -89
  60. data/spec/spec_helper.rb +25 -6
  61. data/spec/support/database.rb +19 -21
  62. data/spec/support/with_model.rb +2 -0
  63. metadata +106 -29
  64. data/.autotest +0 -5
  65. data/.rubocop_todo.yml +0 -163
  66. data/Guardfile +0 -6
data/CHANGELOG.md CHANGED
@@ -1,280 +1,347 @@
1
1
  # pg_search changelog
2
2
 
3
+ ## 2.3.6
4
+
5
+ * Drop support for Ruby 2.5
6
+ * Support Ruby 3.1
7
+ * Support Active Record 7.0
8
+ * Don't require `:against` if `:tsvector_column` is specified (Travis Hunter)
9
+ * Optionally disable transaction when rebuilding documents (Travis Hunter)
10
+ * Preserve columns when chaining ::with_pg_search_highlight (jcsanti)
11
+
12
+ ## 2.3.5
13
+
14
+ * Add table of contents to README (Barry Woolgar)
15
+ * Add support for Active Record 6.1
16
+
17
+ ## 2.3.4
18
+
19
+ * Fix issue when setting various options directly on the `PgSearch` module while
20
+ running with a threaded web server, such as Puma. (Anton Rieder)
21
+
22
+ ## 2.3.3
23
+
24
+ * Drop support for Ruby < 2.5.
25
+ * Use keyword argument for `clean_up` setting in `PgSearch::Multisearch.rebuild`.
26
+
27
+ ## 2.3.2
28
+
29
+ * Autoload `PgSearch::Document` to prevent it from being loaded in projects that are not using multi-search.
30
+ * Rebuilder should use `update_pg_search_document` if `additional_attributes` is set. (David Ramalho)
31
+
32
+ ## 2.3.1
33
+
34
+ * Drop support for Active Record < 5.2.
35
+ * Do not load railtie unless Rails::Railtie is defined, to avoid problem when loading alongside Action Mailer. (Adam Schwartz)
36
+
37
+ ## 2.3.0
38
+
39
+ * Extract `PgSearch::Model` module.
40
+ * Deprecate `include PgSearch`. Use `include PgSearch::Model` instead.
41
+
42
+ ## 2.2.0
43
+
44
+ * Add `word_similarity` option to trigram search. (Severin Räz)
45
+
46
+ ## 2.1.7
47
+
48
+ * Restore link to GitHub repository to original location.
49
+
50
+ ## 2.1.6
51
+
52
+ * Update link to GitHub repository to new location.
53
+
54
+ ## 2.1.5
55
+
56
+ * Drop support for Ruby < 2.4.
57
+
58
+ ## 2.1.4
59
+
60
+ * Drop support for Ruby < 2.3.
61
+ * Use `update` instead of deprecated `update_attributes`.
62
+ * Remove explicit Arel dependency to better support Active Record 6 beta.
63
+
64
+ ## 2.1.3
65
+
66
+ * Drop support for Ruby < 2.2
67
+ * Disallow left/right single quotation marks in tsquery. (Fabian Schwahn) (#382)
68
+ * Do not attempt to save an already-destroyed `PgSearch::Document`. (Oleg Dashevskii, Vokhmin Aleksei V) (#353)
69
+ * Quote column name when rebuilding. (Jed Levin) (#379)
70
+
3
71
  ## 2.1.2
4
72
 
5
- * Silence warnings in Rails 5.2.0.beta2 (Kevin Deisz)
73
+ * Silence warnings in Rails 5.2.0.beta2. (Kevin Deisz)
6
74
 
7
75
  ## 2.1.1
8
76
 
9
- * Support snake_case ts_headline options again (with deprecation warning)
77
+ * Support snake_case `ts_headline` options again. (with deprecation warning)
10
78
 
11
79
  ## 2.1.0
12
80
 
13
- * Allow ts_headline options to be passed to :highlight (Ian Heisters)
14
- * Wait to load PgSearch::Document until after Active Record has loaded (Logan Leger)
15
- * Add Rails version to generated migrations (Erik Eide)
81
+ * Allow `ts_headline` options to be passed to `:highlight`. (Ian Heisters)
82
+ * Wait to load `PgSearch::Document` until after Active Record has loaded. (Logan Leger)
83
+ * Add Rails version to generated migrations. (Erik Eide)
16
84
 
17
85
  ## 2.0.1
18
86
 
19
- * Remove require for generator that no longer exists. (Joshua Bartlett)
87
+ * Remove require for generator that no longer exists. (Joshua Bartlett)
20
88
 
21
89
  ## 2.0.0
22
90
 
23
- * Drop support for PostgreSQL < 9.2.
24
- * Drop support for Active Record < 4.2.
25
- * Drop support for Ruby < 2.1.
26
- * Improve performance of has_one and belongs_to associations. (Peter Postma)
91
+ * Drop support for PostgreSQL < 9.2.
92
+ * Drop support for Active Record < 4.2.
93
+ * Drop support for Ruby < 2.1.
94
+ * Improve performance of has_one and belongs_to associations. (Peter Postma)
27
95
 
28
96
  ## 1.0.6
29
97
 
30
- * Add support for highlighting the matching portion of a search result. (Jose Galisteo)
31
- * Add `:update_if` option to control when PgSearch::Document gets updated. (Adam Becker)
32
- * Add `:additional_attributes` option for adding additional attributes to PgSearch::Document
98
+ * Add support for highlighting the matching portion of a search result. (Jose Galisteo)
99
+ * Add `:update_if` option to control when PgSearch::Document gets updated. (Adam Becker)
100
+ * Add `:additional_attributes` option for adding additional attributes to PgSearch::Document
33
101
 
34
102
  ## 1.0.5
35
103
 
36
- * Clean up rank table aliasing. (Adam Milligan)
37
- * Fix issue when using `#with_pg_search_rank` across a join. (Reid Lynch)
104
+ * Clean up rank table aliasing. (Adam Milligan)
105
+ * Fix issue when using `#with_pg_search_rank` across a join. (Reid Lynch)
38
106
 
39
107
  ## 1.0.4
40
108
 
41
- * Assert valid options for features. (Janko Marohnić)
42
- * Enable chaining of pg_search scopes. (Nicolas Buduroi)
109
+ * Assert valid options for features. (Janko Marohnić)
110
+ * Enable chaining of pg_search scopes. (Nicolas Buduroi)
43
111
 
44
112
  ## 1.0.3
45
113
 
46
- * Support STI models using a custom inheritance column. (Nick Doiron)
114
+ * Support STI models using a custom inheritance column. (Nick Doiron)
47
115
 
48
116
  ## 1.0.2
49
117
 
50
- * Don’t use SQL to rebuild search documents when models are multisearchable against dynamic methods and not just columns. Iterate over each record with `find_each` instead.
118
+ * Don’t use SQL to rebuild search documents when models are multisearchable against dynamic methods and not just columns. Iterate over each record with `find_each` instead.
51
119
 
52
120
  ## 1.0.1
53
121
 
54
- * Call `.unscoped` on relation used to build subquery, to eliminate unnecessary JOINs. (Markus Doits)
122
+ * Call `.unscoped` on relation used to build subquery, to eliminate unnecessary JOINs. (Markus Doits)
55
123
 
56
124
  ## 1.0.0
57
125
 
58
- * Support more `ActiveRecord::Relation` methods, such as `#pluck` and `#select` by moving search-related operations to subquery.
59
- * Generate index by default in migration for `pg_search_documents` table.
60
- * Start officially using [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).
126
+ * Support more `ActiveRecord::Relation` methods, such as `#pluck` and `#select` by moving search-related operations to subquery.
127
+ * Generate index by default in migration for `pg_search_documents` table.
128
+ * Start officially using [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).
61
129
 
62
130
  ## 0.7.9
63
131
 
64
- * Improve support for single table inheritance (STI) models. (Ewan McDougall)
132
+ * Improve support for single table inheritance (STI) models. (Ewan McDougall)
65
133
 
66
134
  ## 0.7.8
67
135
 
68
- * Stop inadvertently including binstubs for guard and rspec.
136
+ * Stop inadvertently including binstubs for guard and rspec.
69
137
 
70
138
  ## 0.7.7
71
139
 
72
- * Fix future compatibility with Active Record 4.2.
140
+ * Fix future compatibility with Active Record 4.2.
73
141
 
74
142
  ## 0.7.6
75
143
 
76
- * Fix migration generator in Rails 3. (Andrew Marshall and Nora Lin)
77
- * Add `:only` option for limiting search fields per feature. (Jonathan Greenberg)
144
+ * Fix migration generator in Rails 3. (Andrew Marshall and Nora Lin)
145
+ * Add `:only` option for limiting search fields per feature. (Jonathan Greenberg)
78
146
 
79
147
  ## 0.7.5
80
148
 
81
- * Add option to make feature available only for sorting. (Brent Wheeldon)
149
+ * Add option to make feature available only for sorting. (Brent Wheeldon)
82
150
 
83
151
  ## 0.7.4
84
152
 
85
- * Fix which STI class name is used for searchable_type for PgSearch::Document. (Ewan McDougall)
86
- * Add support for non-standard primary keys. (Matt Beedle)
153
+ * Fix which STI class name is used for searchable_type for PgSearch::Document. (Ewan McDougall)
154
+ * Add support for non-standard primary keys. (Matt Beedle)
87
155
 
88
156
  ## 0.7.3
89
157
 
90
- * Allow simultaneously searching using `:associated_against` and `:tsvector_column` (Adam Becker)
158
+ * Allow simultaneously searching using `:associated_against` and `:tsvector_column` (Adam Becker)
91
159
 
92
160
  ## 0.7.2
93
161
 
94
- * Add :threshold option for configuring how permissive trigram searches are.
162
+ * Add :threshold option for configuring how permissive trigram searches are.
95
163
 
96
164
  ## 0.7.1
97
165
 
98
- * Fix issue with {:using => :trigram, :ignoring => :accents} that generated
99
- bad SQL. (Steven Harman)
166
+ * Fix issue with {:using => :trigram, :ignoring => :accents} that generated
167
+ bad SQL. (Steven Harman)
100
168
 
101
169
  ## 0.7.0
102
170
 
103
- * Start requiring Ruby 1.9.2 or later.
171
+ * Start requiring Ruby 1.9.2 or later.
104
172
 
105
173
  ## 0.6.4
106
174
 
107
- * Fix issue with using more than two features in the same scope.
175
+ * Fix issue with using more than two features in the same scope.
108
176
 
109
177
  ## 0.6.3
110
178
 
111
- * Fix issues and deprecations for Active Record 4.0.0.rc1.
179
+ * Fix issues and deprecations for Active Record 4.0.0.rc1.
112
180
 
113
181
  ## 0.6.2
114
182
 
115
- * Add workaround for issue with how ActiveRecord relations handle Arel OR
116
- nodes.
183
+ * Add workaround for issue with how ActiveRecord relations handle Arel OR
184
+ nodes.
117
185
 
118
186
  ## 0.6.1
119
187
 
120
- * Fix issue with Arel::InfixOperation that prevented #count from working,
121
- breaking pagination.
188
+ * Fix issue with Arel::InfixOperation that prevented #count from working,
189
+ breaking pagination.
122
190
 
123
191
  ## 0.6.0
124
192
 
125
- * Drop support for Active Record 3.0.
126
- * Address warnings in Ruby 2.0.
127
- * Remove all usages of sanitize_sql_array for future Rails 4 compatibility.
128
- * Start using Arel internally to build SQL strings (not yet complete).
129
- * Disable eager loading, fixes issue #14.
130
- * Support named schemas in pg_search:multisearch:rebuild. (Victor Olteanu)
193
+ * Drop support for Active Record 3.0.
194
+ * Address warnings in Ruby 2.0.
195
+ * Remove all usages of sanitize_sql_array for future Rails 4 compatibility.
196
+ * Start using Arel internally to build SQL strings (not yet complete).
197
+ * Disable eager loading, fixes issue #14.
198
+ * Support named schemas in pg_search:multisearch:rebuild. (Victor Olteanu)
131
199
 
132
200
 
133
201
  ## 0.5.7
134
202
 
135
- * Fix issue with eager loading now that the Scope class has been removed.
136
- (Piotr Murach)
203
+ * Fix issue with eager loading now that the Scope class has been removed.
204
+ (Piotr Murach)
137
205
 
138
206
 
139
207
  ## 0.5.6
140
208
 
141
- * PgSearch#multisearchable accepts :if and :unless for conditional inclusion
142
- in search documents table. (Francois Harbec)
143
- * Stop using array_to_string() in SQL since it is not indexable.
209
+ * PgSearch#multisearchable accepts :if and :unless for conditional inclusion
210
+ in search documents table. (Francois Harbec)
211
+ * Stop using array_to_string() in SQL since it is not indexable.
144
212
 
145
213
 
146
214
  ## 0.5.5
147
215
 
148
- * Fix bug with single table inheritance.
149
- * Allow option for specifying an alternate function for unaccent().
216
+ * Fix bug with single table inheritance.
217
+ * Allow option for specifying an alternate function for unaccent().
150
218
 
151
219
 
152
220
  ## 0.5.4
153
221
 
154
- * Fix bug in associated_against join clause when search scope is chained
155
- after other scopes.
156
- * Fix autoloading of PgSearch::VERSION constant.
222
+ * Fix bug in associated_against join clause when search scope is chained
223
+ after other scopes.
224
+ * Fix autoloading of PgSearch::VERSION constant.
157
225
 
158
226
 
159
227
  ## 0.5.3
160
228
 
161
- * Prevent multiple attempts to create pg_search_document within a single
162
- transaction. (JT Archie & Trace Wax)
229
+ * Prevent multiple attempts to create pg_search_document within a single
230
+ transaction. (JT Archie & Trace Wax)
163
231
 
164
232
 
165
233
  ## 0.5.2
166
234
 
167
- * Don't save twice if pg_search_document is missing on update.
235
+ * Don't save twice if pg_search_document is missing on update.
168
236
 
169
237
 
170
238
  ## 0.5.1
171
239
 
172
- * Add ability to override multisearch rebuild SQL.
240
+ * Add ability to override multisearch rebuild SQL.
173
241
 
174
242
 
175
243
  ## 0.5
176
244
 
177
- * Convert migration rake tasks into generators.
178
- * Use rake task arguments for multisearch rebuild instead of environment
179
- variable.
180
- * Always cast columns to text.
245
+ * Convert migration rake tasks into generators.
246
+ * Use rake task arguments for multisearch rebuild instead of environment
247
+ variable.
248
+ * Always cast columns to text.
181
249
 
182
250
 
183
251
  ## 0.4.2
184
252
 
185
- * Fill in timestamps correctly when rebuilding multisearch documents.
186
- (Barton McGuire)
187
- * Fix various issues with rebuilding multisearch documents. (Eugen Neagoe)
188
- * Fix syntax error in pg_search_dmetaphone() migration. (Casey Foster)
189
- * Rename PgSearch#rank to PgSearch#pg_search_rank and always return a Float.
190
- * Fix issue with :associated_against and non-text columns.
253
+ * Fill in timestamps correctly when rebuilding multisearch documents.
254
+ (Barton McGuire)
255
+ * Fix various issues with rebuilding multisearch documents. (Eugen Neagoe)
256
+ * Fix syntax error in pg_search_dmetaphone() migration. (Casey Foster)
257
+ * Rename PgSearch#rank to PgSearch#pg_search_rank and always return a Float.
258
+ * Fix issue with :associated_against and non-text columns.
191
259
 
192
260
 
193
261
  ## 0.4.1
194
262
 
195
- * Fix Active Record 3.2 deprecation warnings. (Steven Harman)
263
+ * Fix Active Record 3.2 deprecation warnings. (Steven Harman)
196
264
 
197
- * Fix issue with undefined logger when PgSearch::Document.search is already
198
- defined.
265
+ * Fix issue with undefined logger when PgSearch::Document.search is already
266
+ defined.
199
267
 
200
268
 
201
269
  ## 0.4
202
270
 
203
- * Add ability to search again tsvector columns. (Kris Hicks)
271
+ * Add ability to search again tsvector columns. (Kris Hicks)
204
272
 
205
273
 
206
274
  ## 0.3.4
207
275
 
208
- * Fix issue with {:using => {:tsearch => {:prefix => true}}} and hyphens.
209
- * Get tests running against PostgreSQL 9.1 by using CREATE EXTENSION
276
+ * Fix issue with {:using => {:tsearch => {:prefix => true}}} and hyphens.
277
+ * Get tests running against PostgreSQL 9.1 by using CREATE EXTENSION
210
278
 
211
279
 
212
280
  ## 0.3.3
213
281
 
214
- * Backport array_agg() aggregate function to PostgreSQL 8.3 and earlier.
215
- This fixes :associated_against searches.
216
- * Backport unnest() function to PostgreSQL 8.3 and earlier. This fixes
217
- {:using => :dmetaphone} searches.
218
- * Disable {:using => {:tsearch => {:prefix => true}}} in PostgreSQL 8.3 and
219
- earlier.
282
+ * Backport array_agg() aggregate function to PostgreSQL 8.3 and earlier.
283
+ This fixes :associated_against searches.
284
+ * Backport unnest() function to PostgreSQL 8.3 and earlier. This fixes
285
+ {:using => :dmetaphone} searches.
286
+ * Disable {:using => {:tsearch => {:prefix => true}}} in PostgreSQL 8.3 and
287
+ earlier.
220
288
 
221
289
 
222
290
  ## 0.3.2
223
291
 
224
- * Fix :prefix search in PostgreSQL 8.x
225
- * Disable {:ignoring => :accents} in PostgreSQL 8.x
292
+ * Fix :prefix search in PostgreSQL 8.x
293
+ * Disable {:ignoring => :accents} in PostgreSQL 8.x
226
294
 
227
295
 
228
296
  ## 0.3.1
229
297
 
230
- * Fix syntax error in generated dmetaphone migration. (Max De Marzi)
298
+ * Fix syntax error in generated dmetaphone migration. (Max De Marzi)
231
299
 
232
300
 
233
301
  ## 0.3
234
302
 
235
- * Drop Active Record 2.0 support.
236
- * Add PgSearch.multisearch for cross-model searching.
237
- * Fix PostgreSQL warnings about truncated identifiers
238
- * Support specifying a method of rank normalisation when using tsearch.
239
- (Arthur Gunn)
240
- * Add :any_word option to :tsearch which uses OR between query terms instead
241
- of AND. (Fernando Espinosa)
303
+ * Drop Active Record 2.0 support.
304
+ * Add PgSearch.multisearch for cross-model searching.
305
+ * Fix PostgreSQL warnings about truncated identifiers
306
+ * Support specifying a method of rank normalisation when using tsearch.
307
+ (Arthur Gunn)
308
+ * Add :any_word option to :tsearch which uses OR between query terms instead
309
+ of AND. (Fernando Espinosa)
242
310
 
243
311
  ## 0.2.2
244
312
 
245
- * Fix a compatibility issue between Ruby 1.8.7 and 1.9.3 when using Rails 2
246
- (James Badger)
313
+ * Fix a compatibility issue between Ruby 1.8.7 and 1.9.3 when using Rails 2
314
+ (James Badger)
247
315
 
248
316
  ## 0.2.1
249
317
 
250
- * Backport support for searching against tsvector columns (Kris Hicks)
318
+ * Backport support for searching against tsvector columns (Kris Hicks)
251
319
 
252
320
  ## 0.2
253
321
 
254
- * Set dictionary to :simple by default for :tsearch. Before it was unset,
255
- which would fall back to PostgreSQL's default dictionary, usually
256
- "english".
257
- * Fix a bug with search strings containing a colon ":"
258
- * Improve performance of :associated_against by only doing one INNER JOIN
259
- per association
322
+ * Set dictionary to :simple by default for :tsearch. Before it was unset,
323
+ which would fall back to PostgreSQL's default dictionary, usually
324
+ "english".
325
+ * Fix a bug with search strings containing a colon ":"
326
+ * Improve performance of :associated_against by only doing one INNER JOIN
327
+ per association
260
328
 
261
329
  ## 0.1.1
262
330
 
263
- * Fix a bug with dmetaphone searches containing " w " (which dmetaphone maps
264
- to an empty string)
331
+ * Fix a bug with dmetaphone searches containing " w " (which dmetaphone maps
332
+ to an empty string)
265
333
 
266
334
  ## 0.1
267
335
 
268
- * Change API to {:ignoring => :accents} from {:normalizing => :diacritics}
269
- * Improve documentation
270
- * Fix bug where :associated_against would not work without an :against
271
- present
336
+ * Change API to {:ignoring => :accents} from {:normalizing => :diacritics}
337
+ * Improve documentation
338
+ * Fix bug where :associated_against would not work without an :against
339
+ present
272
340
 
273
341
  ## 0.0.2
274
342
 
275
- * Fix gem ownership.
343
+ * Fix gem ownership.
276
344
 
277
- #
278
345
  ## 0.0.1
279
346
 
280
- * Initial release.
347
+ * Initial release.
@@ -0,0 +1,76 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at pg_search@nertzy.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq
data/CONTRIBUTING.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  First off, if you experience a bug, we welcome you to report it. Please provide a minimal test case showing the code that you ran, its output, and what you expected the output to be instead. If you are able to fix the bug and make a pull request, we are much more likely to get it resolved quickly, but don't feel bad to just report an issue if you don't know how to fix it.
4
4
 
5
- pg_search supports Ruby 1.9.2 and higher, Active Record 3.1 and higher, and PostgreSQL 8.0 and higher. It can be hard to test against all of those versions, but please do your best to avoid features that are only available in newer versions. For example, don't use Ruby 2.0's `prepend` keyword.
5
+ View the [README](./README.md) to see which versions of Ruby, Active Record, and PostgreSQL are supported by pg_search. It can be hard to test against all of the various versions, but please do your best to avoid coding practices that only work in newer versions.
6
6
 
7
7
  If you have a substantial feature to add, you might want to discuss it first on the [mailing list](https://groups.google.com/forum/#!forum/casecommons-dev). We might have thought hard about it already, and can sometimes help with tips and tricks.
8
8
 
@@ -10,8 +10,10 @@ When in doubt, go ahead and make a pull request. If something needs tweaking or
10
10
 
11
11
  Don't be discouraged if the maintainers ask you to change your code. We are always appreciative when people work hard to modify our code, but we also have a lot of opinions about coding style and object design.
12
12
 
13
- Run the tests by running rake. It will update all gems to their latest version. This is by design, because we want to be proactive about compatibility with other libraries. To test against a specific version of Active Record, you can set the `ACTIVE_RECORD_VERSION` environment variable.
13
+ Our automated tests start by updating all gems to their latest version. This is by design, because we want to be proactive about compatibility with other libraries. You can do the same by running `bundle update` at any time. To test against a specific version of Active Record, you can set the `ACTIVE_RECORD_VERSION` environment variable.
14
14
 
15
- $ ACTIVE_RECORD_VERSION=3.1 rake
15
+ $ ACTIVE_RECORD_VERSION=5.0 bundle update
16
+
17
+ Run the tests by running `bundle exec rake`, or `bin/rake` if you use Bundler binstubs.
16
18
 
17
19
  Last, but not least, have fun! pg_search is a labor of love.
data/Gemfile CHANGED
@@ -1,13 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
- gem 'pg', '>= 0.21.0', :platform => :ruby
6
- gem "activerecord-jdbcpostgresql-adapter", ">= 1.3.1", :platform => :jruby
7
+ gem 'pg', '>= 0.21.0', platform: :ruby
8
+ gem "activerecord-jdbcpostgresql-adapter", ">= 1.3.1", platform: :jruby
7
9
 
8
10
  if ENV['ACTIVE_RECORD_BRANCH']
9
- gem 'activerecord', :git => 'https://github.com/rails/rails.git', :branch => ENV['ACTIVE_RECORD_BRANCH']
10
- gem 'arel', :git => 'https://github.com/rails/arel.git' if ENV['ACTIVE_RECORD_BRANCH'] == 'master'
11
+ gem 'activerecord', git: 'https://github.com/rails/rails.git', branch: ENV['ACTIVE_RECORD_BRANCH']
12
+ gem 'arel', git: 'https://github.com/rails/arel.git' if ENV['ACTIVE_RECORD_BRANCH'] == 'master'
11
13
  end
12
14
 
13
15
  gem 'activerecord', ENV['ACTIVE_RECORD_VERSION'] if ENV['ACTIVE_RECORD_VERSION']
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2017 Case Commons, Inc. <http://casecommons.org>
1
+ Copyright (c) 2010-2021 Casebook, PBC <http://www.casebook.net>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal