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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87c1e3d344cef64601be578c9efa5e05ca8a0fb2a0443cb81f586c06a3e1009f
4
- data.tar.gz: 361a92b9257df496481556ccb63f78e399168dc021a5461f5a3b5b4e324a401e
3
+ metadata.gz: 235ef23ebc75b949c45a3f6e90c5dac1982d7d774ff45fe322e54e9f668e0e69
4
+ data.tar.gz: e89e29e164da71023324a734b33d54e647accdcbd27ba473d7a7c61ffd2f8122
5
5
  SHA512:
6
- metadata.gz: 4e83c72da829bf31e4113d777f4cede440c1ecb8d3ad7c552225978788956af72030c669b782aa935cc4945990bb02449c224e582643ed8e88694d4b439a1995
7
- data.tar.gz: ade28f1b9fad88a81eeeb0d25a7a3608900c802858f0579a9f0713dd68a655433ce2c2f4504939c83600db20e77e4a28995feb2bd0db2573772c4ba762f00372
6
+ metadata.gz: 53259990ba16f64376e9d16b4f7f49b7fe8332c0bc6d9cfa36d1bd9a41bbd52058e1cd8a76c0307bdb6a7b8e7d2d2dad8bab9d15e266cee882526b6662d00b21
7
+ data.tar.gz: a862717bae96433b5dd22b33e57f83858b318774db1c2148d8270333626ed6b1d19e51b6ac6098b27624b8165b5ca3dabf1e95719c70c9306dd1e2f8d1ef3b32
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'arel-extensions'
3
- gem.version = '6.0.0.8'
3
+ gem.version = '6.0.0.9'
4
4
  gem.authors = ["Jon Bracy"]
5
5
  gem.email = ["jonbracy@gmail.com"]
6
6
  gem.summary = %q{Adds support for missing SQL operators and functions to Arel}
@@ -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
@@ -153,6 +153,10 @@ module Arel
153
153
  visit(o.tsvector, collector)
154
154
  collector << ', '
155
155
  visit(o.tsquery, collector)
156
+ if o.normalization
157
+ collector << ', '
158
+ visit(o.normalization, collector)
159
+ end
156
160
  collector << ')'
157
161
  collector
158
162
  end
@@ -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.8
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-06-26 00:00:00.000000000 Z
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.2
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