activerecord-pg-extensions 0.5.1 → 0.5.3
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7800c41187385465a7c41be2a659111932d738ad2dce00c1fc8be2533bce1c0f
|
|
4
|
+
data.tar.gz: 1c1c93712753319fc786e5306322c69b112cf89e5c8e9397468dcd1af96d1ba3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a899cf16a588bec9832620c7d62c01b2e122ae793ca86bb7388199dd4992b37fa1e778617e89828b9bf4b6b3b8ba2b525340185153352a5e209cf9a92e099cb
|
|
7
|
+
data.tar.gz: be5da7df14af982e7783da3b0559deaefab578d96958f58cfd4e69d6502b93a3126223faf6514d2e43b6c48c4828d227b96173b34c540478de6574e9098152fd
|
|
@@ -90,14 +90,16 @@ module ActiveRecord
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def add_check_constraint(table_name, expression, if_not_exists: false, **options)
|
|
93
|
-
|
|
93
|
+
options = check_constraint_options(table_name, expression, options)
|
|
94
|
+
return if if_not_exists && check_constraint_for(table_name, **options)
|
|
94
95
|
|
|
95
96
|
super
|
|
96
97
|
end
|
|
97
98
|
|
|
98
99
|
if ActiveRecord.version < Gem::Version.new("7.1")
|
|
99
100
|
def remove_check_constraint(table_name, expression = nil, if_exists: false, **options)
|
|
100
|
-
|
|
101
|
+
options = check_constraint_options(table_name, expression, options)
|
|
102
|
+
return if if_exists && !check_constraint_for(table_name, **options)
|
|
101
103
|
|
|
102
104
|
super
|
|
103
105
|
end
|
|
@@ -10,7 +10,7 @@ module ActiveRecord
|
|
|
10
10
|
# see https://www.postgresql.org/docs/current/sql-set-constraints.html
|
|
11
11
|
def set_constraints(deferred, *constraints)
|
|
12
12
|
raise ArgumentError, "deferred must be :deferred or :immediate" unless %i[deferred
|
|
13
|
-
immediate].include?(deferred)
|
|
13
|
+
immediate].include?(deferred.to_sym)
|
|
14
14
|
|
|
15
15
|
constraints = constraints.map { |c| quote_table_name(c) }.join(", ")
|
|
16
16
|
constraints = "ALL" if constraints.empty?
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-pg-extensions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cody Cutrer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-09-
|
|
11
|
+
date: 2023-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|