activerecord-pg-extensions 0.4.1 → 0.4.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45b4e3d0cf437ce75246b882697214a96cf89e44b2b28420b5dd215f243f5351
|
4
|
+
data.tar.gz: c49b15be7227aafe9de557cf78ef4d4938a842b72d28838f2c1bef59d49f1a7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1123584bcfb35e545245c3274e3e1d485ff9080cf46fdcf1788eddbcc7477dcbdc4a3e66c7d3742d3f6f9b701599454b81e994bd8c228eeb77560698c0b2369e
|
7
|
+
data.tar.gz: 5fda99a4141dee1332a889f7123581ceb6ca5e321e064bff89e5015c63d50d73c1e0cb1c0f775ca1d67d29f4d04ff9a7bc7d98c02ea482efabfd8f28e4cb7c7a
|
@@ -12,7 +12,8 @@ module ActiveRecord
|
|
12
12
|
return super if nullness != false || open_transactions.positive?
|
13
13
|
return if columns(table).find { |c| c.name == column.to_s }&.null == false
|
14
14
|
|
15
|
-
|
15
|
+
# PG identifiers max out at 63 characters
|
16
|
+
temp_constraint_name = "chk_rails_#{table}_#{column}_not_null"[0...63]
|
16
17
|
scope = quoted_scope(temp_constraint_name)
|
17
18
|
# check for temp constraint
|
18
19
|
valid = select_value(<<~SQL, "SCHEMA")
|
@@ -63,7 +64,7 @@ module ActiveRecord
|
|
63
64
|
end
|
64
65
|
|
65
66
|
# will automatically remove a NOT VALID index before trying to add
|
66
|
-
def add_index(table_name, column_name, options
|
67
|
+
def add_index(table_name, column_name, **options)
|
67
68
|
# catch a concurrent index add that fails because it already exists, and is invalid
|
68
69
|
if options[:algorithm] == :concurrently || options[:if_not_exists]
|
69
70
|
column_names = index_column_names(column_name)
|
@@ -265,7 +265,7 @@ module ActiveRecord
|
|
265
265
|
#
|
266
266
|
# otherwise, if you're already in a transaction, or you nest with_statement_timeout,
|
267
267
|
# the value will unexpectedly "stick" even after the block returns
|
268
|
-
def with_statement_timeout(timeout)
|
268
|
+
def with_statement_timeout(timeout = nil)
|
269
269
|
timeout = 30 if timeout.nil? || timeout == true
|
270
270
|
|
271
271
|
transaction do
|
data/spec/spec_helper.rb
CHANGED
@@ -29,7 +29,7 @@ module StatementCaptureConnection
|
|
29
29
|
|
30
30
|
%w[execute exec_no_cache exec_cache].each do |method|
|
31
31
|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
32
|
-
def #{method}(statement,
|
32
|
+
def #{method}(statement, *#{Rails.version >= '7.0' ? ', **kwargs' : ''})
|
33
33
|
materialize_transactions # this still needs to get called, even if we skip actually executing
|
34
34
|
executed_statements << statement
|
35
35
|
return empty_pg_result if @dont_execute
|
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.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '6.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '6.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: railties
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '6.0'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '7.1'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '6.0'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '7.1'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: appraisal
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -191,6 +191,7 @@ licenses:
|
|
191
191
|
- MIT
|
192
192
|
metadata:
|
193
193
|
changelog_uri: https://github.com/instructure/activerecord-pg-extensions/blob/main/CHANGELOG.md
|
194
|
+
rubygems_mfa_required: 'true'
|
194
195
|
post_install_message:
|
195
196
|
rdoc_options: []
|
196
197
|
require_paths:
|
@@ -206,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
207
|
- !ruby/object:Gem::Version
|
207
208
|
version: '0'
|
208
209
|
requirements: []
|
209
|
-
rubygems_version: 3.
|
210
|
+
rubygems_version: 3.1.4
|
210
211
|
signing_key:
|
211
212
|
specification_version: 4
|
212
213
|
summary: Several extensions to ActiveRecord's PostgreSQLAdapter.
|