activerecord-redshift-adapter 8.0.0.beta1 → 8.0.0.beta2

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: d981a65a30765fe36e5e58616007f33103f238596de10188107d5e7bbe677093
4
- data.tar.gz: 78f40be0d77ab87f6e4b3b1f6857f84aae35d0b5184a6fe1b320b14c080bbce9
3
+ metadata.gz: 35bf91b5a6116c1055f34e7bb0fc17805e6e693cec22520fc9014010962f2ee3
4
+ data.tar.gz: d4c0213bcee62e43faa979d0fdc1080b590f86d511a4b1f53c2ff623622737ce
5
5
  SHA512:
6
- metadata.gz: f8a9a3801675594bc2a3400c3a4d4657247614b250558c7c169c1f720c0b8f8ce333b29e6a1e621bd3557539c69c8a5ecb160d059049e80ab24d3c531350aecb
7
- data.tar.gz: f75478c7a7df07526ad528e562978bae1918b8146562d42bab6fcf45c8f8eff749b67a3efa5dc08530285642d5ed1003247c2fa64bf3ce60f3482b9824a79580
6
+ metadata.gz: 6075000b038c72d2e516173fa1ee3f29b3c80d2cff8036418f36b919ccc312e8085edfe841394642f906bbe6bf5161ccd6d0c0b42da10af061ce9618425194a1
7
+ data.tar.gz: f797bb18c2b7b4732ff0652b6f50b1f26cf0688a2d1c0eca5c2a0e310405af715f2ecfd1f9537b08dfbbbfb95e928eda10ffd6f35790db11eff5ff6e915d1430
data/README.md CHANGED
@@ -11,7 +11,7 @@ Thanks to the auhors.
11
11
  Usage
12
12
  -------------------
13
13
 
14
- For Rails, write following in Gemfile:
14
+ For Rails, add the following in the Gemfile:
15
15
 
16
16
  ```ruby
17
17
  gem 'activerecord-redshift-adapter'
@@ -30,7 +30,8 @@ development:
30
30
  encoding: utf8
31
31
  ```
32
32
 
33
- or use it directly in the URL when establishing a connection:
33
+ or use it directly in the connection or `DATABASE_URL`:
34
+
34
35
  ```ruby
35
36
  class SomeModel < ApplicationRecord
36
37
  establish_connection('redshift://username:password@host/database')
@@ -330,11 +330,8 @@ module ActiveRecord
330
330
  def translate_exception(exception, message:, sql:, binds:)
331
331
  return exception unless exception.respond_to?(:result)
332
332
 
333
- case exception.message
334
- when /duplicate key value violates unique constraint/
335
- RecordNotUnique.new(message, exception)
336
- when /violates foreign key constraint/
337
- InvalidForeignKey.new(message, exception)
333
+ if exception.is_a?(PG::DuplicateDatabase)
334
+ DatabaseAlreadyExists.new(message, sql: sql, binds: binds)
338
335
  else
339
336
  super
340
337
  end
@@ -353,11 +353,8 @@ module ActiveRecord
353
353
  def translate_exception(exception, message:, sql:, binds:)
354
354
  return exception unless exception.respond_to?(:result)
355
355
 
356
- case exception.message
357
- when /duplicate key value violates unique constraint/
358
- RecordNotUnique.new(message, exception)
359
- when /violates foreign key constraint/
360
- InvalidForeignKey.new(message, exception)
356
+ if exception.is_a?(PG::DuplicateDatabase)
357
+ DatabaseAlreadyExists.new(message, sql: sql, binds: binds)
361
358
  else
362
359
  super
363
360
  end
@@ -353,11 +353,8 @@ module ActiveRecord
353
353
  def translate_exception(exception, message:, sql:, binds:)
354
354
  return exception unless exception.respond_to?(:result)
355
355
 
356
- case exception.message
357
- when /duplicate key value violates unique constraint/
358
- RecordNotUnique.new(message, exception)
359
- when /violates foreign key constraint/
360
- InvalidForeignKey.new(message, exception)
356
+ if exception.is_a?(PG::DuplicateDatabase)
357
+ DatabaseAlreadyExists.new(message, sql: sql, binds: binds)
361
358
  else
362
359
  super
363
360
  end
@@ -353,11 +353,8 @@ module ActiveRecord
353
353
  def translate_exception(exception, message:, sql:, binds:)
354
354
  return exception unless exception.respond_to?(:result)
355
355
 
356
- case exception.message
357
- when /duplicate key value violates unique constraint/
358
- RecordNotUnique.new(message, exception)
359
- when /violates foreign key constraint/
360
- InvalidForeignKey.new(message, exception)
356
+ if exception.is_a?(PG::DuplicateDatabase)
357
+ DatabaseAlreadyExists.new(message, sql: sql, binds: binds)
361
358
  else
362
359
  super
363
360
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-redshift-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0.beta1
4
+ version: 8.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janusz Mordarski
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2024-11-25 00:00:00.000000000 Z
17
+ date: 2024-11-26 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubygems_version: 3.5.22
155
+ rubygems_version: 3.5.23
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Amazon Redshift adapter for ActiveRecord