torque-postgresql 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9e1560c305d73659df33b4dcc71dd57376ab72d898ef1848e54c8aaa5689584e
|
|
4
|
+
data.tar.gz: 0fc8842730a9970f999b52c6a10feb728f16b79086b4389f114ccca12e24f5a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9985681094dc57004a8d823f5f13d5383d965304336d1b9e4a886fa812e8b9dfca5af93504a7b46ed58e7e508fd0d3c8048d367b5b8c36f42f9dc293f2f556bf
|
|
7
|
+
data.tar.gz: 4b23fe90238cb6f0f7c424631e381c27b15bc932e69d46d68dfba9f96a39081d40b80a0ff61266ab1122c24f10242c26a1728e5e737ef847a49c403e8b3e9c88
|
|
@@ -131,8 +131,8 @@ module Torque
|
|
|
131
131
|
|
|
132
132
|
# Parse the search vector operation into a readable format
|
|
133
133
|
def parse_search_vector_options(column, options)
|
|
134
|
-
settings = options[:as]
|
|
135
|
-
return if settings.
|
|
134
|
+
settings = options[:as]&.scan(SEARCH_VECTOR_SCANNER)
|
|
135
|
+
return if settings.blank?
|
|
136
136
|
|
|
137
137
|
languages = settings.map(&:shift).uniq
|
|
138
138
|
return if languages.many?
|
|
@@ -7,7 +7,7 @@ module Torque
|
|
|
7
7
|
|
|
8
8
|
# Create the proper arel join
|
|
9
9
|
class << self
|
|
10
|
-
def build(relation, range, with: nil, as: :series, step: nil, time_zone: nil, mode: :inner, &block)
|
|
10
|
+
def build(relation, range, with: nil, as: :series, step: nil, time_zone: nil, cast: nil, mode: :inner, &block)
|
|
11
11
|
validate_build!(range, step)
|
|
12
12
|
|
|
13
13
|
args = [bind_value(range.begin), bind_value(range.end)]
|
|
@@ -16,7 +16,7 @@ module Torque
|
|
|
16
16
|
|
|
17
17
|
result = Arel::Nodes::Ref.new(as.to_s)
|
|
18
18
|
func = FN.generate_series(*args).as(as.to_s)
|
|
19
|
-
condition = build_join_on(result, relation, with, &block)
|
|
19
|
+
condition = build_join_on(result, relation, with, cast, &block)
|
|
20
20
|
arel_join(mode).new(func, func.create_on(condition))
|
|
21
21
|
end
|
|
22
22
|
|
|
@@ -57,8 +57,7 @@ module Torque
|
|
|
57
57
|
when DateTime
|
|
58
58
|
FN.bind_type(value, :datetime, name: 'series', cast: 'timestamp')
|
|
59
59
|
when ActiveSupport::Duration
|
|
60
|
-
|
|
61
|
-
FN.bind_type(value, type, name: 'series', cast: 'interval')
|
|
60
|
+
FN.bind_type(value.iso8601, :string, name: 'series', cast: 'interval')
|
|
62
61
|
when Date then bind_value(value.to_time(:utc))
|
|
63
62
|
when ::Arel::Attributes::Attribute then value
|
|
64
63
|
else
|
|
@@ -81,14 +80,17 @@ module Torque
|
|
|
81
80
|
end
|
|
82
81
|
|
|
83
82
|
# Build the join on clause
|
|
84
|
-
def build_join_on(result, relation, with)
|
|
83
|
+
def build_join_on(result, relation, with, cast)
|
|
85
84
|
raise ArgumentError, <<~MSG.squish if with.nil? && !block_given?
|
|
86
85
|
missing keyword: :with
|
|
87
86
|
MSG
|
|
88
87
|
|
|
89
88
|
return yield(result, relation.arel_table) if block_given?
|
|
90
89
|
|
|
91
|
-
|
|
90
|
+
with = relation.arel_table[with.to_s] if with.is_a?(Symbol)
|
|
91
|
+
with = with.pg_cast(cast) if cast && with.respond_to?(:pg_cast)
|
|
92
|
+
|
|
93
|
+
(cast ? result.pg_cast(cast) : result).eq(with)
|
|
92
94
|
end
|
|
93
95
|
end
|
|
94
96
|
|
|
@@ -35,7 +35,7 @@ module Torque
|
|
|
35
35
|
|
|
36
36
|
# Merge auxiliary statements activated by +with+
|
|
37
37
|
def merge_auxiliary_statements
|
|
38
|
-
return unless relation.is_a?(Relation::AuxiliaryStatement)
|
|
38
|
+
return unless defined?(Relation::AuxiliaryStatement) && relation.is_a?(Relation::AuxiliaryStatement)
|
|
39
39
|
return if other.auxiliary_statements_values.blank?
|
|
40
40
|
|
|
41
41
|
current = relation.auxiliary_statements_values.map{ |cte| cte.class }
|
|
@@ -60,7 +60,7 @@ module Torque
|
|
|
60
60
|
|
|
61
61
|
# Merge settings related to buckets
|
|
62
62
|
def merge_buckets
|
|
63
|
-
return unless relation.is_a?(Relation::Buckets)
|
|
63
|
+
return unless defined?(Relation::Buckets) && relation.is_a?(Relation::Buckets)
|
|
64
64
|
return if other.buckets_value.blank?
|
|
65
65
|
|
|
66
66
|
relation.buckets_value = other.buckets_value
|
data/spec/schema.rb
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#
|
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
|
12
12
|
|
|
13
|
-
version =
|
|
13
|
+
version = 7
|
|
14
14
|
|
|
15
15
|
return if ActiveRecord::Migrator.current_version == version
|
|
16
16
|
ActiveRecord::Schema.define(version: version) do
|
|
@@ -99,6 +99,7 @@ ActiveRecord::Schema.define(version: version) do
|
|
|
99
99
|
t.enum "types", enum_type: :types, array: true
|
|
100
100
|
t.search_language "lang", null: false, default: 'english'
|
|
101
101
|
t.search_vector "search_vector", columns: :title, language: :lang
|
|
102
|
+
t.tsvector "unhandled"
|
|
102
103
|
t.datetime "created_at", null: false
|
|
103
104
|
t.datetime "updated_at", null: false
|
|
104
105
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: torque-postgresql
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.
|
|
4
|
+
version: 4.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Carlos Silva
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
10
|
+
date: 2025-12-19 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rails
|
|
@@ -303,7 +302,6 @@ metadata:
|
|
|
303
302
|
source_code_uri: https://github.com/crashtech/torque-postgresql
|
|
304
303
|
bug_tracker_uri: https://github.com/crashtech/torque-postgresql/issues
|
|
305
304
|
changelog_uri: https://github.com/crashtech/torque-postgresql/releases
|
|
306
|
-
post_install_message:
|
|
307
305
|
rdoc_options:
|
|
308
306
|
- "--title"
|
|
309
307
|
- Torque PostgreSQL
|
|
@@ -320,8 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
320
318
|
- !ruby/object:Gem::Version
|
|
321
319
|
version: 1.8.11
|
|
322
320
|
requirements: []
|
|
323
|
-
rubygems_version: 3.
|
|
324
|
-
signing_key:
|
|
321
|
+
rubygems_version: 3.6.9
|
|
325
322
|
specification_version: 4
|
|
326
323
|
summary: ActiveRecord extension to access PostgreSQL advanced resources
|
|
327
324
|
test_files:
|
|
@@ -346,8 +343,8 @@ test_files:
|
|
|
346
343
|
- spec/mocks/create_table.rb
|
|
347
344
|
- spec/models/activity.rb
|
|
348
345
|
- spec/models/activity_book.rb
|
|
349
|
-
- spec/models/activity_post/sample.rb
|
|
350
346
|
- spec/models/activity_post.rb
|
|
347
|
+
- spec/models/activity_post/sample.rb
|
|
351
348
|
- spec/models/author.rb
|
|
352
349
|
- spec/models/author_journalist.rb
|
|
353
350
|
- spec/models/category.rb
|