activerecord-pg-extensions 0.5.3 → 0.6.0

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: 7800c41187385465a7c41be2a659111932d738ad2dce00c1fc8be2533bce1c0f
4
- data.tar.gz: 1c1c93712753319fc786e5306322c69b112cf89e5c8e9397468dcd1af96d1ba3
3
+ metadata.gz: 4afe6f86c7d6e70fbe8bf563f3a1a936f037e95843d0a28f40c4cf0116063d09
4
+ data.tar.gz: f698a408ffd364bed38e9b481106f3d585c0b211732d0f200962ffa25abcb13d
5
5
  SHA512:
6
- metadata.gz: 3a899cf16a588bec9832620c7d62c01b2e122ae793ca86bb7388199dd4992b37fa1e778617e89828b9bf4b6b3b8ba2b525340185153352a5e209cf9a92e099cb
7
- data.tar.gz: be5da7df14af982e7783da3b0559deaefab578d96958f58cfd4e69d6502b93a3126223faf6514d2e43b6c48c4828d227b96173b34c540478de6574e9098152fd
6
+ metadata.gz: 4c1edbd6eaeb219958aad2e9c10313c74597f91d47c088f151d2b5aa716fbfa02d13a37196b93fc1f01a20861ba6bc4dc461b9437cbee950aa98d4647c4273c9
7
+ data.tar.gz: 3362f3d6025a904b697793182e83135eca5c667af94dceeefad5039ebb582f8fe1524791f26ce01f8324fd25f7da63d8cad4a019e324e98b9a00c5ad5706136c
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Instructure, Inc.
3
+ Copyright (c) 2021-2023 Instructure, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -16,14 +16,13 @@ See individual classes for available methods.
16
16
 
17
17
  ## Development
18
18
 
19
- You will need Postgres locally to test. As long as `psql` can connect with no arguments, you're fine. Otherwise use environment variables
20
- as described at https://www.postgresql.org/docs/current/libpq-envars.html to configure it. The database will be created automatically.
19
+ Development requires Docker. After checking out the repo, run `docker compose build` to install dependencies.
21
20
 
22
- `rake` will run both tests and Rubocop.
21
+ `docker compose run --rm app rake` will run both tests and Rubocop.
23
22
 
24
- After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
23
+ If using Visual Studio Code, simply click "Reopen in Container" when it pops up.
25
24
 
26
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
25
+ To release a new version, update the version number in `version.rb`, and then run `rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
27
26
 
28
27
  ## Contributing
29
28
 
@@ -112,9 +112,10 @@ module ActiveRecord
112
112
  else
113
113
  old_search_path = schema_search_path
114
114
  manual_rollback = false
115
+ result = nil
115
116
  transaction(requires_new: true) do
116
117
  self.schema_search_path += ",#{schema}"
117
- yield
118
+ result = yield
118
119
  self.schema_search_path = old_search_path
119
120
  rescue ActiveRecord::StatementInvalid, ActiveRecord::Rollback => e
120
121
  # the transaction rolling back will revert the search path change;
@@ -126,6 +127,8 @@ module ActiveRecord
126
127
  # the transaction call will swallow ActiveRecord::Rollback,
127
128
  # but we want it this method to be transparent
128
129
  raise manual_rollback if manual_rollback
130
+
131
+ result
129
132
  end
130
133
  end
131
134
 
@@ -15,6 +15,9 @@ module ActiveRecord
15
15
  return if @#{kind} == timeout
16
16
 
17
17
  @#{kind} = timeout
18
+ # If we have set an explicit timeout, the transaction has state that must be materialized
19
+ # separately from any other transaction, so it cannot be `restartable`
20
+ dirty! unless ::Rails.version < '7.1'
18
21
  return unless materialized?
19
22
  connection.set(#{kind.inspect}, "\#{(timeout * 1000).to_i}ms", local: true)
20
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module PGExtensions
5
- VERSION = "0.5.3"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,71 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-pg-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
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 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '7.0'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: 7.0.0
22
+ version: '8.1'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: 7.0.0
29
+ version: '7.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8.1'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: railties
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: 7.0.0
39
+ version: '7.0'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '8.1'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
39
48
  - !ruby/object:Gem::Version
40
- version: 7.0.0
41
- - !ruby/object:Gem::Dependency
42
- name: appraisal
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '2.4'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
49
+ version: '7.0'
50
+ - - "<"
53
51
  - !ruby/object:Gem::Version
54
- version: '2.4'
52
+ version: '8.1'
55
53
  - !ruby/object:Gem::Dependency
56
- name: byebug
54
+ name: debug
57
55
  requirement: !ruby/object:Gem::Requirement
58
56
  requirements:
59
57
  - - "~>"
60
58
  - !ruby/object:Gem::Version
61
- version: '11.1'
59
+ version: '1.8'
62
60
  type: :development
63
61
  prerelease: false
64
62
  version_requirements: !ruby/object:Gem::Requirement
65
63
  requirements:
66
64
  - - "~>"
67
65
  - !ruby/object:Gem::Version
68
- version: '11.1'
66
+ version: '1.8'
69
67
  - !ruby/object:Gem::Dependency
70
68
  name: pg
71
69
  requirement: !ruby/object:Gem::Requirement
@@ -191,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
189
  - !ruby/object:Gem::Version
192
190
  version: '0'
193
191
  requirements: []
194
- rubygems_version: 3.4.19
192
+ rubygems_version: 3.4.10
195
193
  signing_key:
196
194
  specification_version: 4
197
195
  summary: Several extensions to ActiveRecord's PostgreSQLAdapter.