Skip to content

Commit 4993d87

Browse files
authored
Merge branch 'Casecommons:master' into master
2 parents ccc2e82 + 1f88614 commit 4993d87

4 files changed

Lines changed: 45 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ jobs:
4141
- ACTIVE_RECORD_VERSION="~> 6.1.0"
4242
- ACTIVE_RECORD_VERSION="~> 7.0.0"
4343
- ACTIVE_RECORD_VERSION="~> 7.1.0"
44+
- ACTIVE_RECORD_VERSION="~> 7.2.0"
4445
allow-failure: [false]
46+
exclude:
47+
- ruby-version: '3.0'
48+
active-record-version-env: ACTIVE_RECORD_VERSION="~> 7.2.0"
4549
include:
4650
- ruby-version: '3.3'
4751
active-record-version-env: ACTIVE_RECORD_BRANCH="main"
4852
allow-failure: true
53+
- ruby-version: '3.3'
54+
active-record-version-env: ACTIVE_RECORD_BRANCH="7-2-stable"
55+
allow-failure: true
4956
- ruby-version: '3.3'
5057
active-record-version-env: ACTIVE_RECORD_BRANCH="7-1-stable"
5158
allow-failure: true
@@ -57,7 +64,7 @@ jobs:
5764
allow-failure: true
5865
continue-on-error: ${{ matrix.allow-failure }}
5966
steps:
60-
- uses: actions/checkout@v3
67+
- uses: actions/checkout@v4
6168
- name: Set up Ruby
6269
uses: ruby/setup-ruby@v1
6370
with:

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# pg_search changelog
22

3+
## 2.3.7
4+
5+
* Drop support for Ruby 2.6 and 2.7
6+
* Drop support for Active Record 6.0 and earlier
7+
* Support Ruby 3.2 and 3.3
8+
* Support Active Record 7.1
9+
* Support Active Record 7.2 (fatkodima)
10+
* Add U+02BB/U+02BC to disallowed tsquery characters (Vital Ryabchinskiy)
11+
* add support for Arel::Nodes::SqlLiteral columns (Kyle Fazzari)
12+
* Improve documentation (Prima Aulia Gusta, Ross Baird, Andy Atkinson)
13+
314
## 2.3.6
415

516
* Drop support for Ruby 2.5

lib/pg_search/scope_options.rb

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,32 @@ def subquery
9090
end
9191

9292
def conditions
93-
config.features
94-
.reject { |_feature_name, feature_options| feature_options && feature_options[:sort_only] }
95-
.map { |feature_name, _feature_options| feature_for(feature_name).conditions }
96-
.inject { |accumulator, expression| Arel::Nodes::Or.new(accumulator, expression) }
93+
expressions =
94+
config.features
95+
.reject { |_feature_name, feature_options| feature_options && feature_options[:sort_only] }
96+
.map { |feature_name, _feature_options| feature_for(feature_name).conditions }
97+
98+
or_node(expressions)
99+
end
100+
101+
# https://github.com/rails/rails/pull/51492
102+
# :nocov:
103+
# standard:disable Lint/DuplicateMethods
104+
or_arity = Arel::Nodes::Or.instance_method(:initialize).arity
105+
case or_arity
106+
when 1
107+
def or_node(expressions)
108+
Arel::Nodes::Or.new(expressions)
109+
end
110+
when 2
111+
def or_node(expressions)
112+
expressions.inject { |accumulator, expression| Arel::Nodes::Or.new(accumulator, expression) }
113+
end
114+
else
115+
raise "Unsupported arity #{or_arity} for Arel::Nodes::Or#initialize"
97116
end
117+
# :nocov:
118+
# standard:enable Lint/DuplicateMethods
98119

99120
def order_within_rank
100121
config.order_within_rank || "#{primary_key} ASC"

lib/pg_search/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module PgSearch
4-
VERSION = "2.3.6"
4+
VERSION = "2.3.7"
55
end

0 commit comments

Comments
 (0)