database_validations 0.9.4 → 1.0.0

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: 5cea34b87885accbde526d9a36bcfcda30b0ae23dd474ee9d3ccbd19b729cdb5
4
- data.tar.gz: bf86e7012afed03710c09ab205388d08a6c0c3b34a8cce77423fca40916ae03e
3
+ metadata.gz: 2e13dbc2023a631be57aaacd12ec2c75ca9b7b355e7015737df4b760713b5756
4
+ data.tar.gz: 8b84441e52646fba283120a8e33d40bdb43162f31f202e2cd07e6f5fa6dbb03e
5
5
  SHA512:
6
- metadata.gz: 1ed0995301de6de0e5169d0e5b3e333ce9b0417014e423094aa5293055dec0ee8657f1a8661d466f8ccdce64020e33378c4c4f4623da5fa5b6755408e0253ff4
7
- data.tar.gz: 3d08f422bff52c0e3942dbdb60ab867c891bd1802f12f90fd97305a66bc5bdf01158aa5ba94c418fab6e8ed88db41cc05cacaee47a7ddad95d77dffdfd6c799e
6
+ metadata.gz: 324f867954cf0b2660431e6da9b5851f3ccae84b6ff2e5d10de6149b336387adc7c07a4e295748c75663a18822436c88578c6d246e869238f56d0e3563bc1f2e
7
+ data.tar.gz: 3d99ab395db1b3b493e372c22674283cd7822bd6de89cbcd71b08218cfec96eee709538dd89a872977edd936434564798a20e1af8e837c1f886fbd3a9f8e345c
@@ -8,7 +8,13 @@ module DatabaseValidations
8
8
  module_function
9
9
 
10
10
  def factory(model)
11
- case (database = model.connection_config[:adapter].downcase.to_sym)
11
+ database = if ActiveRecord.version < Gem::Version.new('6.1.0')
12
+ model.connection_config[:adapter].downcase.to_sym
13
+ else
14
+ model.connection_db_config.adapter.downcase.to_sym
15
+ end
16
+
17
+ case database
12
18
  when SqliteAdapter::ADAPTER then SqliteAdapter
13
19
  when PostgresqlAdapter::ADAPTER then PostgresqlAdapter
14
20
  when MysqlAdapter::ADAPTER then MysqlAdapter
@@ -1,3 +1,3 @@
1
1
  module DatabaseValidations
2
- VERSION = '0.9.4'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-30 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
225
  requirements: []
226
- rubygems_version: 3.0.8
226
+ rubygems_version: 3.1.2
227
227
  signing_key:
228
228
  specification_version: 4
229
229
  summary: Provide compatibility between database constraints and ActiveRecord validations