arel-extensions 6.0.0.8 → 6.0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/arel-extensions.gemspec +1 -1
- data/lib/arel/nodes/ts_rank_cd.rb +3 -2
- data/lib/arel/visitors/postgresql_extensions.rb +4 -0
- data/test/ts_test.rb +15 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 235ef23ebc75b949c45a3f6e90c5dac1982d7d774ff45fe322e54e9f668e0e69
|
4
|
+
data.tar.gz: e89e29e164da71023324a734b33d54e647accdcbd27ba473d7a7c61ffd2f8122
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53259990ba16f64376e9d16b4f7f49b7fe8332c0bc6d9cfa36d1bd9a41bbd52058e1cd8a76c0307bdb6a7b8e7d2d2dad8bab9d15e266cee882526b6662d00b21
|
7
|
+
data.tar.gz: a862717bae96433b5dd22b33e57f83858b318774db1c2148d8270333626ed6b1d19e51b6ac6098b27624b8165b5ca3dabf1e95719c70c9306dd1e2f8d1ef3b32
|
data/arel-extensions.gemspec
CHANGED
@@ -2,11 +2,12 @@ module Arel
|
|
2
2
|
module Nodes
|
3
3
|
class TSRankCD < Arel::Nodes::Node
|
4
4
|
|
5
|
-
attr_reader :tsvector, :tsquery
|
5
|
+
attr_reader :tsvector, :tsquery, :normalization
|
6
6
|
|
7
|
-
def initialize(tsvector, tsquery)
|
7
|
+
def initialize(tsvector, tsquery, normalization=nil)
|
8
8
|
@tsvector = tsvector
|
9
9
|
@tsquery = tsquery
|
10
|
+
@normalization = normalization
|
10
11
|
end
|
11
12
|
|
12
13
|
end
|
data/test/ts_test.rb
CHANGED
@@ -133,4 +133,19 @@ class TSTest < ActiveSupport::TestCase
|
|
133
133
|
SQL
|
134
134
|
end
|
135
135
|
|
136
|
+
test 'ts_rank_cd(tsvector, tsquery, normalization)' do
|
137
|
+
query = Property.where(
|
138
|
+
Arel::Nodes::TSRankCD.new(
|
139
|
+
Arel::Nodes::TSVector.new(Property.arel_table[:name]),
|
140
|
+
Arel::Nodes::TSQuery.new('query'),
|
141
|
+
5
|
142
|
+
)
|
143
|
+
)
|
144
|
+
|
145
|
+
assert_equal(<<~SQL.gsub(/( +|\n)/, ' ').strip, query.to_sql)
|
146
|
+
SELECT "properties".* FROM "properties"
|
147
|
+
WHERE ts_rank_cd(to_tsvector("properties"."name"), to_tsquery('query'), 5)
|
148
|
+
SQL
|
149
|
+
end
|
150
|
+
|
136
151
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arel-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.0.
|
4
|
+
version: 6.0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
|
-
rubygems_version: 3.1.
|
207
|
+
rubygems_version: 3.1.4
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: Adds support for missing SQL operators and functions to Arel
|