activestorage-multi_node_disk 0.1.0 → 0.1.1

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: d354671f0910267b48241ec1225870aa5ac97a5b3fd1e484f4f8fe7523a4be43
4
- data.tar.gz: ccbe3a767a0cc540727d421e4779bf8014194ea7746d14731552872f54a0f96d
3
+ metadata.gz: 0ab5ed3cac5873413b1c2ff121a8bbe5b551a1ef13b243ad2f1562c1c0bb2187
4
+ data.tar.gz: e54afda800d09ffc008af042e81c54dc168bc355e887406ef0a3f94a0e541c9a
5
5
  SHA512:
6
- metadata.gz: 8bc81e5ecbbe8b81c8b0a9e1bee4c8112644e366fc0f68632d0a8ccf6cdf23745215b34374e202fcf9dd7cb7f107bce780ee7ba60a24da1a420bff4f4a5db507
7
- data.tar.gz: 90c49f600de770e09b48ac0fe78bba4c6514a4cf8f72d018f6b2a223325b03ddb5651e14ad72635302cabd62357bf9e7ea932f810debea9e5e107d439367dee4
6
+ metadata.gz: c0c584a2ac8073bf73d766073018dc9e229f54b1d3c35989ad8dae0e0a94bd85d98628dbeb7c25390f058725a27f1c9680c3813ed5ac648908c200ac6e20dc3d
7
+ data.tar.gz: 9bdc7dc391b4695b3135c49dde92394295be0c97096263636bb30310309709f46a34ad96482b33b6dc331c11948289a2ee335e61ccf42db268d8dd9e45aac670
data/CHANGELOG.md CHANGED
@@ -7,6 +7,31 @@ minor version may change public APIs; each entry says how.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.1] - 2026-11-10
11
+
12
+ ### Security
13
+
14
+ - Development dependencies take their patched releases: Rails 8.1.4.1
15
+ (including Active Storage, for GHSA-f3w6-w445-fwh9), Rack 3.2.8, Nokogiri
16
+ 1.19.7, Loofah 2.25.3, Crass 1.0.8, rails-html-sanitizer 1.7.2, Addressable
17
+ 2.9.2, sqlite3 2.10.2 and Trilogy 2.13.3. The gem's runtime requirement
18
+ (`activestorage >= 8.1, < 9`) is unchanged; hosts should update Rails
19
+ themselves.
20
+
21
+ ### Changed
22
+
23
+ - Development uses Ruby 4.0.9 and Bundler 4.0.24. CI pins
24
+ `ruby/setup-ruby` v1.338.0 and its PostgreSQL 17 and MySQL 8.0 service
25
+ images by digest.
26
+
27
+ ### Fixed
28
+
29
+ - The audit migration from `install --audit` now finishes a run that stopped
30
+ part way: each statement has its own guard (`table_exists?`,
31
+ `index_exists?`), so a table left without its index gets the index, and on
32
+ Oracle an empty table left without its sequence is dropped and recreated.
33
+ Hosts that already ran the migration need not change anything.
34
+
10
35
  ## [0.1.0] - 2026-10-20
11
36
 
12
37
  The first release.
@@ -39,5 +64,6 @@ The first release.
39
64
  - `ActiveStorage::MultiNodeDisk::TestHelper`: fake nodes answered by the real
40
65
  endpoint in process.
41
66
 
42
- [Unreleased]: https://github.com/clearstackio/activestorage-multi_node_disk/compare/v0.1.0...HEAD
67
+ [Unreleased]: https://github.com/clearstackio/activestorage-multi_node_disk/compare/v0.1.1...HEAD
68
+ [0.1.1]: https://github.com/clearstackio/activestorage-multi_node_disk/compare/v0.1.0...v0.1.1
43
69
  [0.1.0]: https://github.com/clearstackio/activestorage-multi_node_disk/releases/tag/v0.1.0
data/CONTRIBUTING.md CHANGED
@@ -10,7 +10,7 @@ notice.
10
10
 
11
11
  ## Setup
12
12
 
13
- Tools are pinned in `mise.toml` (Ruby 4.0.7; the gem supports 3.3+).
13
+ Tools are pinned in `mise.toml` (Ruby 4.0.9; the gem supports 3.3+).
14
14
 
15
15
  ```sh
16
16
  bin/setup # mise install, bundle install, rake
@@ -75,7 +75,7 @@ publisher on rubygems.org (Profile → Trusted publishers): gem
75
75
  run `bundle install` so `Gemfile.lock` follows.
76
76
  2. Move the `[Unreleased]` entries in `CHANGELOG.md` under the new version
77
77
  and date, and update the compare links at the bottom.
78
- 3. Commit, then tag and push: `git tag v0.1.0 && git push origin master v0.1.0`.
78
+ 3. Commit, then tag and push: `git tag vX.Y.Z && git push origin master vX.Y.Z`.
79
79
 
80
80
  The workflow checks the tag matches `VERSION`, runs `rake`, then builds,
81
81
  pushes and attests the gem.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveStorage
4
4
  module MultiNodeDisk
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -1,19 +1,22 @@
1
1
  # The :table audit sink (activestorage-multi_node_disk): one row per entry,
2
2
  # the whole entry in payload. Runs on PostgreSQL (jsonb), MySQL 8 (json),
3
3
  # Oracle (CLOB) and SQLite (text); the model reads it with
4
- # `attribute :payload, :json`. Safe to run again; reversible.
4
+ # `attribute :payload, :json`. Safe to run again (each statement has its
5
+ # own guard: a run stopped after CREATE TABLE must still add the index);
6
+ # reversible.
5
7
  class CreateActiveStorageMultiNodeDiskAudits < ActiveRecord::Migration<%= migration_version %>
6
8
  TABLE = :<%= table_name %>
7
9
  INDEX = "<%= index_name %>"
8
10
 
9
11
  def up
10
- return if table_exists?(TABLE)
11
-
12
- create_table TABLE do |t|
13
- t.column :payload, payload_type, null: false
14
- t.datetime :created_at, null: false
12
+ drop_table TABLE if table_without_sequence?(TABLE)
13
+ unless table_exists?(TABLE)
14
+ create_table TABLE do |t|
15
+ t.column :payload, payload_type, null: false
16
+ t.datetime :created_at, null: false
17
+ end
15
18
  end
16
- add_index TABLE, :created_at, name: INDEX
19
+ add_index TABLE, :created_at, name: INDEX unless index_exists?(TABLE, :created_at, name: INDEX)
17
20
  end
18
21
 
19
22
  def down
@@ -22,6 +25,17 @@ class CreateActiveStorageMultiNodeDiskAudits < ActiveRecord::Migration<%= migrat
22
25
 
23
26
  private
24
27
 
28
+ # Oracle creates the table, then its sequence, in two statements; a run
29
+ # stopped between them left an empty table nothing can insert into
30
+ # (ORA-02289). Raw SQL, Oracle only: Rails has no sequence probe. It reads
31
+ # the session's current schema, as table_exists? does (`schema:` setting).
32
+ def table_without_sequence?(table)
33
+ connection.adapter_name.match?(/oracle/i) && table_exists?(table) &&
34
+ select_value("SELECT COUNT(*) FROM all_sequences WHERE sequence_owner = SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') " \
35
+ "AND sequence_name = #{quote(default_sequence_name(table.to_s, nil).upcase)}").to_i.zero? &&
36
+ select_value("SELECT COUNT(*) FROM #{table}").to_i.zero?
37
+ end
38
+
25
39
  # JSON where the database has a JSON type; a CLOB (text) elsewhere.
26
40
  def payload_type
27
41
  case connection.adapter_name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage-multi_node_disk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ajaya Agrawalla