activerecord-pg-extensions 0.5.1 → 0.5.3

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: 2f00b73b6ca45b6816eb823afa1cb16213baf9a9671d02c5633c4cf07fa92026
4
- data.tar.gz: 84f12098d7d3d638671cdbcf32e9e1f4e56ece8b64cc799f167b2eff336cc7dd
3
+ metadata.gz: 7800c41187385465a7c41be2a659111932d738ad2dce00c1fc8be2533bce1c0f
4
+ data.tar.gz: 1c1c93712753319fc786e5306322c69b112cf89e5c8e9397468dcd1af96d1ba3
5
5
  SHA512:
6
- metadata.gz: 414294a360874650bedada98a2ccb4fb73fe8f2eb85d2c020387280dd84739af6807c703c016f4c7027c030ffb2f57cc4a1e493104a08ec79b599993b36f56c1
7
- data.tar.gz: 8333b90a0265330c6f9f99d8826839003086816726f041e685916254de9cecd89db4ee2b9815975080b40cdd9be784ddd24d1f96322a8bba12c6971c2f91f3a6
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
- return if if_not_exists && check_constraint_for(table_name, expression, **options)
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
- return if if_exists && !check_constraint_for(table_name, expression, **options)
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?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module PGExtensions
5
- VERSION = "0.5.1"
5
+ VERSION = "0.5.3"
6
6
  end
7
7
  end
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.1
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-07 00:00:00.000000000 Z
11
+ date: 2023-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord