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 +4 -4
- data/lib/database_validations/lib/adapters.rb +7 -1
- data/lib/database_validations/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e13dbc2023a631be57aaacd12ec2c75ca9b7b355e7015737df4b760713b5756
|
4
|
+
data.tar.gz: 8b84441e52646fba283120a8e33d40bdb43162f31f202e2cd07e6f5fa6dbb03e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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.
|
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:
|
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.
|
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
|