torque-postgresql 3.4.0 → 3.4.1

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: 84962b5a78fc9b09f10f35c091e90ec83e71786a8e6b98d2e88468376b7fc20e
4
- data.tar.gz: 4637773971675c9381075895134efc16e0589ec7b4a4219e92bd7b6e6a34eb5d
3
+ metadata.gz: c61aaf577483288d5c9a9af30704402529c86318cbdc312f567b643955c1443e
4
+ data.tar.gz: ccb9930f10cd48eb08448ecd99275fd7ca7ef54443fab81476c6b3a57c03e394
5
5
  SHA512:
6
- metadata.gz: f36770306242b9bfce00fa8216080be72970ec2b69f3f1b3e98dbf30151f1017699a0d3f9c731154b60ecddba17cd382e56e116edaf701aa2549dc25a9ab000f
7
- data.tar.gz: 9ecbd264e042f773a9e93bf414a233932ec4ed5663125894f2e3011d0a6f1c829f41fdbdee3f30ed891df2bfe9adce174dd7bfd29eb2bbe615c31a4bf124a787
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.respond_to?(:val) ? o.val : o.value
28
+ value = o.value_for_database
29
29
  return super unless value.is_a?(::Enumerable)
30
30
  quote_array(value, collector)
31
31
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Torque
4
4
  module PostgreSQL
5
- VERSION = '3.4.0'
5
+ VERSION = '3.4.1'
6
6
  end
7
7
  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 = 3
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
@@ -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.0
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-08-18 00:00:00.000000000 Z
11
+ date: 2024-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails