torque-postgresql 3.4.0 → 3.4.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 +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 +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c61aaf577483288d5c9a9af30704402529c86318cbdc312f567b643955c1443e
|
4
|
+
data.tar.gz: ccb9930f10cd48eb08448ecd99275fd7ca7ef54443fab81476c6b3a57c03e394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34ed5cb4bb34b33de90020a7053378378b28ff0f45cc7a33e53084fa86c9069ab7694890fa0cac1ab19a85f5ee825cc317d3406cf8f98d4336ff416a2bae092b
|
7
|
+
data.tar.gz: 22771a0e4b1ce1486ae0ae6700c81cbbf84b227bb78b1a7163be2d2948b7161e822bb32dfdcc399c103348e2ab89f8cdda04112f988d303fd0735e178a605043
|
@@ -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 = o.
|
28
|
+
value = o.value_for_database
|
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
@@ -62,6 +62,11 @@ RSpec.describe 'Arel' do
|
|
62
62
|
it 'does not break jsonb' do
|
63
63
|
expect { connection.add_column(:authors, :profile, :jsonb, default: []) }.not_to raise_error
|
64
64
|
expect(Author.columns_hash['profile'].default).to eq('[]')
|
65
|
+
|
66
|
+
condition = Author.arel_table['profile'].is_distinct_from([])
|
67
|
+
expect(Author.where(condition).to_sql).to eq(<<~SQL.squish)
|
68
|
+
SELECT "authors".* FROM "authors" WHERE "authors"."profile" IS DISTINCT FROM '[]'
|
69
|
+
SQL
|
65
70
|
end
|
66
71
|
|
67
72
|
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: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Silva
|
8
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
|