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: ca67149b2f8917743b8258c14b7d2e393673093d02956a192ce40ed7857efa89
4
- data.tar.gz: df37221b1ba08633bcb1d059ae296c4f83ec2025e6ad35eb87aaf50c7fdbaf39
3
+ metadata.gz: 45b4e3d0cf437ce75246b882697214a96cf89e44b2b28420b5dd215f243f5351
4
+ data.tar.gz: c49b15be7227aafe9de557cf78ef4d4938a842b72d28838f2c1bef59d49f1a7f
5
5
  SHA512:
6
- metadata.gz: 60739ca5ec1d417e709792231bc06b65af4f6d2e6cac2a883a725bc5acd553d901a2d7c2d9b7da2e1a592f2f66635e740d668070a05551ffcfbefff3b4102dba
7
- data.tar.gz: 6e34ef248fb441a9dcbdd60e4a2566e9010b01900b7802c33653e77744c9d7c9d33a65f78649118beb20bdc1fc283775232a7b834d4d514a3c8ea797d7698ee4
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
- temp_constraint_name = "chk_rails_#{table}_#{column}_not_null"
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module PGExtensions
5
- VERSION = "0.4.1"
5
+ VERSION = "0.4.4"
6
6
  end
7
7
  end
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.1
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: 2021-09-30 00:00:00.000000000 Z
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: '6.2'
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: '6.2'
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: '6.2'
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: '6.2'
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.2.24
210
+ rubygems_version: 3.1.4
210
211
  signing_key:
211
212
  specification_version: 4
212
213
  summary: Several extensions to ActiveRecord's PostgreSQLAdapter.