foundries 0.1.5 → 0.1.6

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: 05ac2ed1c8c00feab7b078f4e3dcd9b5fd8c24fdb6c1f7278aab3c4df6f85898
4
- data.tar.gz: 174371e6e22eb9b6764dd4d70fb90988bc276e4a0e32c032b45254d924261f80
3
+ metadata.gz: 12575eccffc55ee4735cc1fe6cb981ed1109d252d45b6435ab4b8333862f2663
4
+ data.tar.gz: 5ecb9d8707258542b76ec9e72caf4daa3619d72c0dff8f4778163a880302aa3b
5
5
  SHA512:
6
- metadata.gz: f79398b03c229960553bb6d2283254f5fa832166e497811ba7fc488db50a499288ee987a379f18e92cdc3a237bae6dcc41aefb5c6ddb1f3ecc861b7f354b62cb
7
- data.tar.gz: 8870ca65270252f4f7f29392e456a230c167aa170a7d6bacc54d6a10452e3398a42fefc3767d283faac944e0620c800d9c58dd1170bbeff4f932fdf282fcc48e
6
+ metadata.gz: bb1eba53555fdf59b449b06cef7e973516341d2806ceed56d42d2e26a43e58be877bf6459cb551b71610acb6790a7f001a3761b5098b25245bb8d3c58be6805e
7
+ data.tar.gz: ef7bd963c7c76e978a96ffed6562358a47cbfdb0da52e873f9613b4aecb3bcc357a4143282b7ff743ddada31e142fcdb8bd395035fa99291dbef4b890d06f419
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
+ ## [0.1.6] - 2026-08-25
9
+
10
+ ### Fixed
11
+
12
+ - Snapshot files are read and written in binary, so captured data with non-ASCII bytes round-trips (6a7d3a3)
13
+ - Restoring a snapshot no longer rewinds a sequence below its current value (df66836)
14
+
8
15
  ## [0.1.5] - 2026-08-12
9
16
 
10
17
  ### Changed
@@ -16,14 +23,3 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
16
23
  - Snapshot no longer caches a partial tree when a preset writes to a table that already held rows (2e9f863)
17
24
  - Lint under standard 1.56.0 (52be9eb)
18
25
  - Releases write a SHA512 checksum again (813a2ae)
19
-
20
- ## [0.1.4] - 2026-03-16
21
-
22
- ### Added
23
-
24
- - Recording module to analyze FactoryBot usage and suggest preset candidates (a294324)
25
- - parallel_tests support for Recording with per-worker output and merge rake task (8e59deb)
26
-
27
- ### Changed
28
-
29
- - README now covers Recording feature and parallel_tests support (69fa45b)
@@ -55,10 +55,14 @@ module Foundries
55
55
  )
56
56
  return unless seq
57
57
 
58
- max_id = @connection.select_value(
59
- "SELECT COALESCE(MAX(#{@connection.quote_column_name(pk)}), 0) FROM #{quoted(table_name)}"
58
+ # setval is not transactional, and rows can already be committed
59
+ # past the restored data (e.g. seeded outside this transaction), so
60
+ # the sequence must only ever move forward.
61
+ @connection.execute(
62
+ "SELECT setval(#{@connection.quote(seq)}, GREATEST(" \
63
+ "(SELECT COALESCE(MAX(#{@connection.quote_column_name(pk)}), 0) FROM #{quoted(table_name)}), " \
64
+ "(SELECT last_value FROM #{seq})))"
60
65
  )
61
- @connection.execute("SELECT setval(#{@connection.quote(seq)}, #{max_id})")
62
66
  end
63
67
 
64
68
  private
@@ -59,7 +59,7 @@ module Foundries
59
59
  tmp_dir.mkpath
60
60
 
61
61
  tables.each do |table|
62
- tmp_dir.join("#{table}.dat").open("w") do |f|
62
+ tmp_dir.join("#{table}.dat").open("wb") do |f|
63
63
  @adapter.capture(table, f)
64
64
  end
65
65
  end
@@ -77,7 +77,7 @@ module Foundries
77
77
  next unless file.size > 0
78
78
 
79
79
  table = file.basename(".dat").to_s
80
- file.open("r") do |f|
80
+ file.open("rb") do |f|
81
81
  @adapter.restore(table, f)
82
82
  end
83
83
  @adapter.reset_sequence(table)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Foundries
4
- VERSION = "0.1.5"
5
- RELEASE_DATE = "2026-08-12"
4
+ VERSION = "0.1.6"
5
+ RELEASE_DATE = "2026-08-25"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foundries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Dowd