torque-postgresql 2.4.4 → 2.4.5
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 +4 -4
- data/lib/torque/postgresql/arel/visitors.rb +1 -1
- data/lib/torque/postgresql/version.rb +1 -1
- data/spec/schema.rb +2 -1
- data/spec/tests/arel_spec.rb +6 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06fd189e192b540302d0438f76f85e201a8bdebd15c5112681f7eb3a6d7de296
|
4
|
+
data.tar.gz: d0408fd8ff6663a801c274d6703e00e31ea4ab18bf54ff89e86fc862b39b1bfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a00263e8641f8b9e2b0a5c715c106a68c8478fd6084ea88f880c0719556ad06d79ac5e83e25527640ccdaf1a3b5be7644e4907a0872762180eb036fb70d7db0d
|
7
|
+
data.tar.gz: 2b3f308029481f90727f005ee55f43667f3393bd89ea80e82df4f78726bbeb18519d9b987d2f375838f51d79ae36caabaeec4c80809ef2aeb914e2ffa4237569
|
@@ -25,7 +25,7 @@ module Torque
|
|
25
25
|
|
26
26
|
# Allow quoted arrays to get here
|
27
27
|
def visit_Arel_Nodes_Casted(o, collector)
|
28
|
-
value =
|
28
|
+
value = PostgreSQL::AR610 ? o.value_for_database : o.val
|
29
29
|
return super unless value.is_a?(::Enumerable)
|
30
30
|
quote_array(value, collector)
|
31
31
|
end
|
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 = 4
|
14
14
|
|
15
15
|
return if ActiveRecord::Migrator.current_version == version
|
16
16
|
ActiveRecord::Schema.define(version: version) do
|
@@ -59,6 +59,7 @@ ActiveRecord::Schema.define(version: version) do
|
|
59
59
|
t.string "url"
|
60
60
|
t.enum "type", enum_type: :types
|
61
61
|
t.enum "conflicts", enum_type: :conflicts, array: true
|
62
|
+
t.jsonb "metadata"
|
62
63
|
t.datetime "created_at", null: false
|
63
64
|
t.datetime "updated_at", null: false
|
64
65
|
end
|
data/spec/tests/arel_spec.rb
CHANGED
@@ -64,6 +64,12 @@ RSpec.describe 'Arel' do
|
|
64
64
|
it 'does not break jsonb' do
|
65
65
|
expect { connection.add_column(:authors, :profile, :jsonb, default: []) }.not_to raise_error
|
66
66
|
expect(Author.columns_hash['profile'].default).to eq('[]')
|
67
|
+
|
68
|
+
condition = Author.arel_table['profile'].is_distinct_from([])
|
69
|
+
result = Torque::PostgreSQL::AR610 ? "'[]'" : "ARRAY[]"
|
70
|
+
expect(Author.where(condition).to_sql).to eq(<<~SQL.squish)
|
71
|
+
SELECT "authors".* FROM "authors" WHERE "authors"."profile" IS DISTINCT FROM #{result}
|
72
|
+
SQL
|
67
73
|
end
|
68
74
|
|
69
75
|
it 'works properly when column is an array' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torque-postgresql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Silva
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -305,7 +305,7 @@ licenses:
|
|
305
305
|
metadata:
|
306
306
|
source_code_uri: https://github.com/crashtech/torque-postgresql
|
307
307
|
bug_tracker_uri: https://github.com/crashtech/torque-postgresql/issues
|
308
|
-
post_install_message:
|
308
|
+
post_install_message:
|
309
309
|
rdoc_options:
|
310
310
|
- "--title"
|
311
311
|
- Torque PostgreSQL
|
@@ -322,8 +322,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
322
322
|
- !ruby/object:Gem::Version
|
323
323
|
version: 1.8.11
|
324
324
|
requirements: []
|
325
|
-
rubygems_version: 3.
|
326
|
-
signing_key:
|
325
|
+
rubygems_version: 3.4.10
|
326
|
+
signing_key:
|
327
327
|
specification_version: 4
|
328
328
|
summary: ActiveRecord extension to access PostgreSQL advanced resources
|
329
329
|
test_files:
|