pg_search 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +11 -7
  3. data/.travis.yml +33 -42
  4. data/CHANGELOG.md +140 -112
  5. data/CONTRIBUTING.md +5 -3
  6. data/Gemfile +6 -4
  7. data/LICENSE +1 -1
  8. data/README.md +221 -159
  9. data/Rakefile +3 -5
  10. data/lib/pg_search/configuration/association.rb +2 -0
  11. data/lib/pg_search/configuration/column.rb +2 -0
  12. data/lib/pg_search/configuration/foreign_column.rb +2 -0
  13. data/lib/pg_search/configuration.rb +8 -4
  14. data/lib/pg_search/document.rb +5 -3
  15. data/lib/pg_search/features/dmetaphone.rb +3 -1
  16. data/lib/pg_search/features/feature.rb +4 -2
  17. data/lib/pg_search/features/trigram.rb +31 -5
  18. data/lib/pg_search/features/tsearch.rb +4 -1
  19. data/lib/pg_search/features.rb +2 -0
  20. data/lib/pg_search/migration/dmetaphone_generator.rb +3 -1
  21. data/lib/pg_search/migration/generator.rb +4 -2
  22. data/lib/pg_search/migration/multisearch_generator.rb +2 -1
  23. data/lib/pg_search/migration/templates/create_pg_search_documents.rb.erb +1 -1
  24. data/lib/pg_search/multisearch/rebuilder.rb +7 -3
  25. data/lib/pg_search/multisearch.rb +4 -4
  26. data/lib/pg_search/multisearchable.rb +10 -6
  27. data/lib/pg_search/normalizer.rb +2 -0
  28. data/lib/pg_search/railtie.rb +2 -0
  29. data/lib/pg_search/scope_options.rb +21 -41
  30. data/lib/pg_search/tasks.rb +3 -0
  31. data/lib/pg_search/version.rb +3 -1
  32. data/lib/pg_search.rb +10 -5
  33. data/pg_search.gemspec +8 -7
  34. data/spec/integration/associations_spec.rb +103 -101
  35. data/spec/integration/pagination_spec.rb +9 -7
  36. data/spec/integration/pg_search_spec.rb +266 -255
  37. data/spec/integration/single_table_inheritance_spec.rb +16 -15
  38. data/spec/lib/pg_search/configuration/association_spec.rb +7 -5
  39. data/spec/lib/pg_search/configuration/column_spec.rb +2 -0
  40. data/spec/lib/pg_search/configuration/foreign_column_spec.rb +5 -3
  41. data/spec/lib/pg_search/features/dmetaphone_spec.rb +6 -4
  42. data/spec/lib/pg_search/features/trigram_spec.rb +39 -12
  43. data/spec/lib/pg_search/features/tsearch_spec.rb +23 -21
  44. data/spec/lib/pg_search/multisearch/rebuilder_spec.rb +32 -11
  45. data/spec/lib/pg_search/multisearch_spec.rb +9 -7
  46. data/spec/lib/pg_search/multisearchable_spec.rb +68 -27
  47. data/spec/lib/pg_search/normalizer_spec.rb +7 -5
  48. data/spec/lib/pg_search_spec.rb +33 -31
  49. data/spec/spec_helper.rb +3 -1
  50. data/spec/support/database.rb +16 -20
  51. data/spec/support/with_model.rb +2 -0
  52. metadata +13 -30
  53. data/.rubocop_todo.yml +0 -163
  54. data/Guardfile +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 39a86d998120bf6ec9643f8f8b549b08956576ff
4
- data.tar.gz: fd3a0e7c1aea025553e4c1747d009a9911628d37
2
+ SHA256:
3
+ metadata.gz: 292701a98892eef31e95d8b5d723e94ce71fd47e4956e8bed595b8f87797f49c
4
+ data.tar.gz: cc08372ce5c032e288c28b2f6409c218d361b271fc271de08acbe8e5430c8dcb
5
5
  SHA512:
6
- metadata.gz: 84aa3f0816a2aca1523b9bd418abb4445b2290eb5a3177870e43a52e1ca341271e9211042496198b8e2d9ba7c39c6b53afd2f10bc272544478976bafde763265
7
- data.tar.gz: e4657a3efc304b264cb0640c1755be9f9cbbc01afb1804f5625dfea24498f5ab21b1e707801cf3c22df63e462bb7add5e737060a6f9b67ddbfbae600d53a3a5c
6
+ metadata.gz: e95e7240968269703ae6d010639f2b4380e7616962c7a07f4932ad5e21c77affae6ea3c90e9a8171641a506988fa076ecdb30224f2b081d1468fb13618713d2e
7
+ data.tar.gz: 4910a636f53e444c3995e0ca728bd21475d11347d8a4d8223a1e881f3360bf8dc7e4f5689bd05cc559dad106a08b077abda1b3f50c6108221e4dbf75c4d73ffa
data/.rubocop.yml CHANGED
@@ -1,8 +1,10 @@
1
- inherit_from: .rubocop_todo.yml
1
+ require: rubocop-performance
2
2
 
3
3
  AllCops:
4
+ TargetRubyVersion: 2.4
4
5
  Exclude:
5
6
  - bin/**/*
7
+ - vendor/**/*
6
8
 
7
9
  Style/StringLiterals:
8
10
  Enabled: false
@@ -20,9 +22,6 @@ Metrics/BlockLength:
20
22
  Layout/AlignParameters:
21
23
  EnforcedStyle: with_fixed_indentation
22
24
 
23
- Style/HashSyntax:
24
- Enabled: false
25
-
26
25
  Style/NumericPredicate:
27
26
  Enabled: false
28
27
 
@@ -45,8 +44,13 @@ Bundler/DuplicatedGem:
45
44
 
46
45
  Style/EmptyMethod:
47
46
  EnforcedStyle: expanded
47
+
48
+ Layout/IndentFirstArrayElement:
49
+ EnforcedStyle: consistent
48
50
 
49
- # Waiting on false positives to go away with:
50
- # https://github.com/bbatsov/rubocop/pull/5230
51
- Style/FormatStringToken:
51
+ Style/Documentation:
52
52
  Enabled: false
53
+
54
+ Style/WordArray:
55
+ EnforcedStyle: percent
56
+ MinSize: 3
data/.travis.yml CHANGED
@@ -1,59 +1,50 @@
1
1
  language: ruby
2
2
  sudo: false
3
+ bundler_args: --binstubs
4
+ cache: bundler
3
5
 
4
6
  rvm:
5
- - "2.4.1"
6
- - "2.3.4"
7
- - "2.2.7"
8
- - "2.1.10"
9
- - jruby-9.1.14.0
7
+ - 2.6.3
8
+ - 2.5.5
9
+ - 2.4.6
10
+ - jruby-9.2.6.0
10
11
 
11
12
  env:
12
- - ACTIVE_RECORD_BRANCH="master"
13
- - ACTIVE_RECORD_BRANCH="5-1-stable"
14
- - ACTIVE_RECORD_BRANCH="5-0-stable"
15
- - ACTIVE_RECORD_BRANCH="4-2-stable"
16
- - ACTIVE_RECORD_VERSION="~> 5.2.0.beta2"
17
- - ACTIVE_RECORD_VERSION="~> 5.1.0"
18
- - ACTIVE_RECORD_VERSION="~> 5.0.0"
19
- - ACTIVE_RECORD_VERSION="~> 4.2.9"
13
+ global:
14
+ - CC_TEST_REPORTER_ID=0a0e3e45118bc447e677d52c21d056a5471c4921d54f96ed7b2550d9fc5043ea
15
+ matrix:
16
+ - ACTIVE_RECORD_BRANCH="master"
17
+ - ACTIVE_RECORD_BRANCH="5-2-stable"
18
+ - ACTIVE_RECORD_VERSION="~> 6.0.0.beta1"
19
+ - ACTIVE_RECORD_VERSION="~> 5.2.0"
20
+ - ACTIVE_RECORD_VERSION="~> 5.1.0"
21
+ - ACTIVE_RECORD_VERSION="~> 5.0.0"
22
+ - ACTIVE_RECORD_VERSION="~> 4.2.9"
20
23
 
21
24
  matrix:
22
25
  allow_failures:
23
26
  - env: ACTIVE_RECORD_BRANCH="master"
24
- - env: ACTIVE_RECORD_BRANCH="5-1-stable"
25
- - env: ACTIVE_RECORD_BRANCH="5-0-stable"
26
- - env: ACTIVE_RECORD_BRANCH="4-2-stable"
27
- - rvm: jruby-9.1.14.0
27
+ - env: ACTIVE_RECORD_BRANCH="5-2-stable"
28
+ - env: ACTIVE_RECORD_VERSION="~> 6.0.0.beta1"
28
29
  exclude:
29
- - rvm: "2.1.10"
30
+ - rvm: 2.4.6
30
31
  env: ACTIVE_RECORD_BRANCH="master"
31
- - rvm: "2.1.10"
32
- env: ACTIVE_RECORD_BRANCH="5-1-stable"
33
- - rvm: "2.1.10"
34
- env: ACTIVE_RECORD_BRANCH="5-0-stable"
35
- - rvm: "2.1.10"
36
- env: ACTIVE_RECORD_VERSION="~> 5.1.0"
37
- - rvm: "2.1.10"
38
- env: ACTIVE_RECORD_VERSION="~> 5.0.0"
39
- - rvm: jruby-9.1.14.0
40
- env: ACTIVE_RECORD_BRANCH="master"
41
- - rvm: jruby-9.1.14.0
42
- env: ACTIVE_RECORD_BRANCH="5-1-stable"
43
- - rvm: jruby-9.1.14.0
44
- env: ACTIVE_RECORD_BRANCH="5-0-stable"
45
- - rvm: jruby-9.1.14.0
46
- env: ACTIVE_RECORD_VERSION="~> 5.2.0.beta2"
47
- - rvm: jruby-9.1.14.0
48
- env: ACTIVE_RECORD_VERSION="~> 5.1.0"
49
- - rvm: jruby-9.1.14.0
50
- env: ACTIVE_RECORD_VERSION="~> 5.0.0"
32
+ - rvm: jruby-9.2.6.0
33
+ env: ACTIVE_RECORD_VERSION="~> 4.2.9"
34
+ - rvm: 2.4.5
35
+ env: ACTIVE_RECORD_VERSION="~> 6.0.0.beta1"
51
36
 
52
37
  before_script:
53
- - "psql -c 'create database pg_search_test;' -U postgres >/dev/null"
38
+ - psql --version
39
+ - psql -c 'create database pg_search_test;' -U postgres >/dev/null
40
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
41
+ - chmod +x ./cc-test-reporter
42
+ - ./cc-test-reporter before-build
43
+
44
+ script: bin/rake
54
45
 
55
- script: "bin/rake"
46
+ after_script:
47
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
56
48
 
57
49
  addons:
58
- code_climate:
59
- repo_token: 0a0e3e45118bc447e677d52c21d056a5471c4921d54f96ed7b2550d9fc5043ea
50
+ postgresql: "9.6"
data/CHANGELOG.md CHANGED
@@ -1,280 +1,308 @@
1
1
  # pg_search changelog
2
2
 
3
+ ## 2.2.0
4
+
5
+ * Add word_similarity option to trigram search (Severin Räz)
6
+
7
+ ## 2.1.7
8
+
9
+ * Restore link to GitHub repository to original location
10
+
11
+ ## 2.1.6
12
+
13
+ * Update link to GitHub repository to new location
14
+
15
+ ## 2.1.5
16
+
17
+ * Drop support for Ruby < 2.4
18
+
19
+ ## 2.1.4
20
+
21
+ * Drop support for Ruby < 2.3
22
+ * Use update instead of deprecated update_attributes
23
+ * Remove explicit arel dependency to better support Active Record 6 beta
24
+
25
+ ## 2.1.3
26
+
27
+ * Drop support for Ruby < 2.2
28
+ * Disallow left/right single quotation marks in tsquery (Fabian Schwahn) (#382)
29
+ * Do not attempt to save an already-destroy PgSearch::Document (Oleg Dashevskii, Vokhmin Aleksei V) (#353)
30
+ * Quote column name when rebuilding (Jed Levin) (#379)
31
+
3
32
  ## 2.1.2
4
33
 
5
- * Silence warnings in Rails 5.2.0.beta2 (Kevin Deisz)
34
+ * Silence warnings in Rails 5.2.0.beta2 (Kevin Deisz)
6
35
 
7
36
  ## 2.1.1
8
37
 
9
- * Support snake_case ts_headline options again (with deprecation warning)
38
+ * Support snake_case ts_headline options again (with deprecation warning)
10
39
 
11
40
  ## 2.1.0
12
41
 
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)
42
+ * Allow ts_headline options to be passed to :highlight (Ian Heisters)
43
+ * Wait to load PgSearch::Document until after Active Record has loaded (Logan Leger)
44
+ * Add Rails version to generated migrations (Erik Eide)
16
45
 
17
46
  ## 2.0.1
18
47
 
19
- * Remove require for generator that no longer exists. (Joshua Bartlett)
48
+ * Remove require for generator that no longer exists. (Joshua Bartlett)
20
49
 
21
50
  ## 2.0.0
22
51
 
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)
52
+ * Drop support for PostgreSQL < 9.2.
53
+ * Drop support for Active Record < 4.2.
54
+ * Drop support for Ruby < 2.1.
55
+ * Improve performance of has_one and belongs_to associations. (Peter Postma)
27
56
 
28
57
  ## 1.0.6
29
58
 
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
59
+ * Add support for highlighting the matching portion of a search result. (Jose Galisteo)
60
+ * Add `:update_if` option to control when PgSearch::Document gets updated. (Adam Becker)
61
+ * Add `:additional_attributes` option for adding additional attributes to PgSearch::Document
33
62
 
34
63
  ## 1.0.5
35
64
 
36
- * Clean up rank table aliasing. (Adam Milligan)
37
- * Fix issue when using `#with_pg_search_rank` across a join. (Reid Lynch)
65
+ * Clean up rank table aliasing. (Adam Milligan)
66
+ * Fix issue when using `#with_pg_search_rank` across a join. (Reid Lynch)
38
67
 
39
68
  ## 1.0.4
40
69
 
41
- * Assert valid options for features. (Janko Marohnić)
42
- * Enable chaining of pg_search scopes. (Nicolas Buduroi)
70
+ * Assert valid options for features. (Janko Marohnić)
71
+ * Enable chaining of pg_search scopes. (Nicolas Buduroi)
43
72
 
44
73
  ## 1.0.3
45
74
 
46
- * Support STI models using a custom inheritance column. (Nick Doiron)
75
+ * Support STI models using a custom inheritance column. (Nick Doiron)
47
76
 
48
77
  ## 1.0.2
49
78
 
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.
79
+ * 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
80
 
52
81
  ## 1.0.1
53
82
 
54
- * Call `.unscoped` on relation used to build subquery, to eliminate unnecessary JOINs. (Markus Doits)
83
+ * Call `.unscoped` on relation used to build subquery, to eliminate unnecessary JOINs. (Markus Doits)
55
84
 
56
85
  ## 1.0.0
57
86
 
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).
87
+ * Support more `ActiveRecord::Relation` methods, such as `#pluck` and `#select` by moving search-related operations to subquery.
88
+ * Generate index by default in migration for `pg_search_documents` table.
89
+ * Start officially using [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).
61
90
 
62
91
  ## 0.7.9
63
92
 
64
- * Improve support for single table inheritance (STI) models. (Ewan McDougall)
93
+ * Improve support for single table inheritance (STI) models. (Ewan McDougall)
65
94
 
66
95
  ## 0.7.8
67
96
 
68
- * Stop inadvertently including binstubs for guard and rspec.
97
+ * Stop inadvertently including binstubs for guard and rspec.
69
98
 
70
99
  ## 0.7.7
71
100
 
72
- * Fix future compatibility with Active Record 4.2.
101
+ * Fix future compatibility with Active Record 4.2.
73
102
 
74
103
  ## 0.7.6
75
104
 
76
- * Fix migration generator in Rails 3. (Andrew Marshall and Nora Lin)
77
- * Add `:only` option for limiting search fields per feature. (Jonathan Greenberg)
105
+ * Fix migration generator in Rails 3. (Andrew Marshall and Nora Lin)
106
+ * Add `:only` option for limiting search fields per feature. (Jonathan Greenberg)
78
107
 
79
108
  ## 0.7.5
80
109
 
81
- * Add option to make feature available only for sorting. (Brent Wheeldon)
110
+ * Add option to make feature available only for sorting. (Brent Wheeldon)
82
111
 
83
112
  ## 0.7.4
84
113
 
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)
114
+ * Fix which STI class name is used for searchable_type for PgSearch::Document. (Ewan McDougall)
115
+ * Add support for non-standard primary keys. (Matt Beedle)
87
116
 
88
117
  ## 0.7.3
89
118
 
90
- * Allow simultaneously searching using `:associated_against` and `:tsvector_column` (Adam Becker)
119
+ * Allow simultaneously searching using `:associated_against` and `:tsvector_column` (Adam Becker)
91
120
 
92
121
  ## 0.7.2
93
122
 
94
- * Add :threshold option for configuring how permissive trigram searches are.
123
+ * Add :threshold option for configuring how permissive trigram searches are.
95
124
 
96
125
  ## 0.7.1
97
126
 
98
- * Fix issue with {:using => :trigram, :ignoring => :accents} that generated
99
- bad SQL. (Steven Harman)
127
+ * Fix issue with {:using => :trigram, :ignoring => :accents} that generated
128
+ bad SQL. (Steven Harman)
100
129
 
101
130
  ## 0.7.0
102
131
 
103
- * Start requiring Ruby 1.9.2 or later.
132
+ * Start requiring Ruby 1.9.2 or later.
104
133
 
105
134
  ## 0.6.4
106
135
 
107
- * Fix issue with using more than two features in the same scope.
136
+ * Fix issue with using more than two features in the same scope.
108
137
 
109
138
  ## 0.6.3
110
139
 
111
- * Fix issues and deprecations for Active Record 4.0.0.rc1.
140
+ * Fix issues and deprecations for Active Record 4.0.0.rc1.
112
141
 
113
142
  ## 0.6.2
114
143
 
115
- * Add workaround for issue with how ActiveRecord relations handle Arel OR
116
- nodes.
144
+ * Add workaround for issue with how ActiveRecord relations handle Arel OR
145
+ nodes.
117
146
 
118
147
  ## 0.6.1
119
148
 
120
- * Fix issue with Arel::InfixOperation that prevented #count from working,
121
- breaking pagination.
149
+ * Fix issue with Arel::InfixOperation that prevented #count from working,
150
+ breaking pagination.
122
151
 
123
152
  ## 0.6.0
124
153
 
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)
154
+ * Drop support for Active Record 3.0.
155
+ * Address warnings in Ruby 2.0.
156
+ * Remove all usages of sanitize_sql_array for future Rails 4 compatibility.
157
+ * Start using Arel internally to build SQL strings (not yet complete).
158
+ * Disable eager loading, fixes issue #14.
159
+ * Support named schemas in pg_search:multisearch:rebuild. (Victor Olteanu)
131
160
 
132
161
 
133
162
  ## 0.5.7
134
163
 
135
- * Fix issue with eager loading now that the Scope class has been removed.
136
- (Piotr Murach)
164
+ * Fix issue with eager loading now that the Scope class has been removed.
165
+ (Piotr Murach)
137
166
 
138
167
 
139
168
  ## 0.5.6
140
169
 
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.
170
+ * PgSearch#multisearchable accepts :if and :unless for conditional inclusion
171
+ in search documents table. (Francois Harbec)
172
+ * Stop using array_to_string() in SQL since it is not indexable.
144
173
 
145
174
 
146
175
  ## 0.5.5
147
176
 
148
- * Fix bug with single table inheritance.
149
- * Allow option for specifying an alternate function for unaccent().
177
+ * Fix bug with single table inheritance.
178
+ * Allow option for specifying an alternate function for unaccent().
150
179
 
151
180
 
152
181
  ## 0.5.4
153
182
 
154
- * Fix bug in associated_against join clause when search scope is chained
155
- after other scopes.
156
- * Fix autoloading of PgSearch::VERSION constant.
183
+ * Fix bug in associated_against join clause when search scope is chained
184
+ after other scopes.
185
+ * Fix autoloading of PgSearch::VERSION constant.
157
186
 
158
187
 
159
188
  ## 0.5.3
160
189
 
161
- * Prevent multiple attempts to create pg_search_document within a single
162
- transaction. (JT Archie & Trace Wax)
190
+ * Prevent multiple attempts to create pg_search_document within a single
191
+ transaction. (JT Archie & Trace Wax)
163
192
 
164
193
 
165
194
  ## 0.5.2
166
195
 
167
- * Don't save twice if pg_search_document is missing on update.
196
+ * Don't save twice if pg_search_document is missing on update.
168
197
 
169
198
 
170
199
  ## 0.5.1
171
200
 
172
- * Add ability to override multisearch rebuild SQL.
201
+ * Add ability to override multisearch rebuild SQL.
173
202
 
174
203
 
175
204
  ## 0.5
176
205
 
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.
206
+ * Convert migration rake tasks into generators.
207
+ * Use rake task arguments for multisearch rebuild instead of environment
208
+ variable.
209
+ * Always cast columns to text.
181
210
 
182
211
 
183
212
  ## 0.4.2
184
213
 
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.
214
+ * Fill in timestamps correctly when rebuilding multisearch documents.
215
+ (Barton McGuire)
216
+ * Fix various issues with rebuilding multisearch documents. (Eugen Neagoe)
217
+ * Fix syntax error in pg_search_dmetaphone() migration. (Casey Foster)
218
+ * Rename PgSearch#rank to PgSearch#pg_search_rank and always return a Float.
219
+ * Fix issue with :associated_against and non-text columns.
191
220
 
192
221
 
193
222
  ## 0.4.1
194
223
 
195
- * Fix Active Record 3.2 deprecation warnings. (Steven Harman)
224
+ * Fix Active Record 3.2 deprecation warnings. (Steven Harman)
196
225
 
197
- * Fix issue with undefined logger when PgSearch::Document.search is already
198
- defined.
226
+ * Fix issue with undefined logger when PgSearch::Document.search is already
227
+ defined.
199
228
 
200
229
 
201
230
  ## 0.4
202
231
 
203
- * Add ability to search again tsvector columns. (Kris Hicks)
232
+ * Add ability to search again tsvector columns. (Kris Hicks)
204
233
 
205
234
 
206
235
  ## 0.3.4
207
236
 
208
- * Fix issue with {:using => {:tsearch => {:prefix => true}}} and hyphens.
209
- * Get tests running against PostgreSQL 9.1 by using CREATE EXTENSION
237
+ * Fix issue with {:using => {:tsearch => {:prefix => true}}} and hyphens.
238
+ * Get tests running against PostgreSQL 9.1 by using CREATE EXTENSION
210
239
 
211
240
 
212
241
  ## 0.3.3
213
242
 
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.
243
+ * Backport array_agg() aggregate function to PostgreSQL 8.3 and earlier.
244
+ This fixes :associated_against searches.
245
+ * Backport unnest() function to PostgreSQL 8.3 and earlier. This fixes
246
+ {:using => :dmetaphone} searches.
247
+ * Disable {:using => {:tsearch => {:prefix => true}}} in PostgreSQL 8.3 and
248
+ earlier.
220
249
 
221
250
 
222
251
  ## 0.3.2
223
252
 
224
- * Fix :prefix search in PostgreSQL 8.x
225
- * Disable {:ignoring => :accents} in PostgreSQL 8.x
253
+ * Fix :prefix search in PostgreSQL 8.x
254
+ * Disable {:ignoring => :accents} in PostgreSQL 8.x
226
255
 
227
256
 
228
257
  ## 0.3.1
229
258
 
230
- * Fix syntax error in generated dmetaphone migration. (Max De Marzi)
259
+ * Fix syntax error in generated dmetaphone migration. (Max De Marzi)
231
260
 
232
261
 
233
262
  ## 0.3
234
263
 
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)
264
+ * Drop Active Record 2.0 support.
265
+ * Add PgSearch.multisearch for cross-model searching.
266
+ * Fix PostgreSQL warnings about truncated identifiers
267
+ * Support specifying a method of rank normalisation when using tsearch.
268
+ (Arthur Gunn)
269
+ * Add :any_word option to :tsearch which uses OR between query terms instead
270
+ of AND. (Fernando Espinosa)
242
271
 
243
272
  ## 0.2.2
244
273
 
245
- * Fix a compatibility issue between Ruby 1.8.7 and 1.9.3 when using Rails 2
246
- (James Badger)
274
+ * Fix a compatibility issue between Ruby 1.8.7 and 1.9.3 when using Rails 2
275
+ (James Badger)
247
276
 
248
277
  ## 0.2.1
249
278
 
250
- * Backport support for searching against tsvector columns (Kris Hicks)
279
+ * Backport support for searching against tsvector columns (Kris Hicks)
251
280
 
252
281
  ## 0.2
253
282
 
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
283
+ * Set dictionary to :simple by default for :tsearch. Before it was unset,
284
+ which would fall back to PostgreSQL's default dictionary, usually
285
+ "english".
286
+ * Fix a bug with search strings containing a colon ":"
287
+ * Improve performance of :associated_against by only doing one INNER JOIN
288
+ per association
260
289
 
261
290
  ## 0.1.1
262
291
 
263
- * Fix a bug with dmetaphone searches containing " w " (which dmetaphone maps
264
- to an empty string)
292
+ * Fix a bug with dmetaphone searches containing " w " (which dmetaphone maps
293
+ to an empty string)
265
294
 
266
295
  ## 0.1
267
296
 
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
297
+ * Change API to {:ignoring => :accents} from {:normalizing => :diacritics}
298
+ * Improve documentation
299
+ * Fix bug where :associated_against would not work without an :against
300
+ present
272
301
 
273
302
  ## 0.0.2
274
303
 
275
- * Fix gem ownership.
304
+ * Fix gem ownership.
276
305
 
277
- #
278
306
  ## 0.0.1
279
307
 
280
- * Initial release.
308
+ * Initial release.
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', '< 1.0.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-2019 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