archive_hook 0.1.0 → 0.1.2
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile +0 -3
- data/README.md +6 -0
- data/archive_hook.gemspec +5 -1
- data/lib/archive_hook/version.rb +1 -1
- metadata +42 -9
- data/Gemfile.lock +0 -176
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e54918283bc4fcb9f8c3890c51191fe8b844e0d82d6fe6f5316c2af38a3ebc3e
|
|
4
|
+
data.tar.gz: 2126bf291081eb4943422c7ff7ac3fc57ace9faa9904c94904a3ccf780355de6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aba9e9c6ec17d9b92cc90915e48ed451daf3c82aa8cd723a4700b1d1e2da07c504e2374b0c6ca5f8667cae59e69f679c45a851e4fd9c38034c60b0d24d1c4c62
|
|
7
|
+
data.tar.gz: 677fcee118a322e088f6c8c66dffd8a9b7468812f3025182bfa4ffa6714cf6635088fe5928dfe788316bc624bc93f7273a6577ce7b6b47f3e459fae4403f9a42
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -48,6 +48,12 @@ end
|
|
|
48
48
|
Run the generator for the root model and for every model listed under a `children:` entry in
|
|
49
49
|
your dependency mapping (see below) — each one needs its own `_archive` table.
|
|
50
50
|
|
|
51
|
+
> **Postgres only (for now):** the generator's `CREATE TABLE ... (LIKE ...)` is Postgres syntax.
|
|
52
|
+
> On other databases, write the `_archive` table migration by hand instead — the archiving and
|
|
53
|
+
> restoring API itself (`.archive`, `.archive_scope`, `.restore_scope`) is plain SQL
|
|
54
|
+
> (`INSERT INTO ... SELECT`, `DELETE ... WHERE id IN (...)`) run through the ActiveRecord
|
|
55
|
+
> connection, so it isn't tied to any particular adapter.
|
|
56
|
+
|
|
51
57
|
`ArchiveHook` reads the columns off the model at call time, so the archive table just needs to
|
|
52
58
|
have matching column names — it doesn't need matching constraints, indexes, or an FK to the
|
|
53
59
|
original table.
|
data/archive_hook.gemspec
CHANGED
|
@@ -32,7 +32,11 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
33
33
|
spec.require_paths = ["lib"]
|
|
34
34
|
|
|
35
|
+
# Only ActiveRecord (+ Arel, bundled with it) is used at runtime; no need for full Rails.
|
|
36
|
+
spec.add_dependency "activerecord", ">= 5.2", "< 9"
|
|
37
|
+
|
|
35
38
|
spec.add_development_dependency "bundler", "~> 2.3"
|
|
36
|
-
spec.add_development_dependency "
|
|
39
|
+
spec.add_development_dependency "pg"
|
|
40
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
37
41
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
38
42
|
end
|
data/lib/archive_hook/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: archive_hook
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- alvir
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: activerecord
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '5.2'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '9'
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '5.2'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '9'
|
|
13
33
|
- !ruby/object:Gem::Dependency
|
|
14
34
|
name: bundler
|
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -24,20 +44,34 @@ dependencies:
|
|
|
24
44
|
- - "~>"
|
|
25
45
|
- !ruby/object:Gem::Version
|
|
26
46
|
version: '2.3'
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: pg
|
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
type: :development
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
27
61
|
- !ruby/object:Gem::Dependency
|
|
28
62
|
name: rake
|
|
29
63
|
requirement: !ruby/object:Gem::Requirement
|
|
30
64
|
requirements:
|
|
31
65
|
- - "~>"
|
|
32
66
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
67
|
+
version: '13.0'
|
|
34
68
|
type: :development
|
|
35
69
|
prerelease: false
|
|
36
70
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
71
|
requirements:
|
|
38
72
|
- - "~>"
|
|
39
73
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
74
|
+
version: '13.0'
|
|
41
75
|
- !ruby/object:Gem::Dependency
|
|
42
76
|
name: rspec
|
|
43
77
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,7 +100,6 @@ files:
|
|
|
66
100
|
- ".travis.yml"
|
|
67
101
|
- CODE_OF_CONDUCT.md
|
|
68
102
|
- Gemfile
|
|
69
|
-
- Gemfile.lock
|
|
70
103
|
- LICENSE.txt
|
|
71
104
|
- README.md
|
|
72
105
|
- Rakefile
|
|
@@ -84,7 +117,7 @@ licenses:
|
|
|
84
117
|
metadata:
|
|
85
118
|
homepage_uri: https://github.com/alvir/archive_hook
|
|
86
119
|
source_code_uri: https://github.com/alvir/archive_hook
|
|
87
|
-
post_install_message:
|
|
120
|
+
post_install_message:
|
|
88
121
|
rdoc_options: []
|
|
89
122
|
require_paths:
|
|
90
123
|
- lib
|
|
@@ -99,8 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
99
132
|
- !ruby/object:Gem::Version
|
|
100
133
|
version: '0'
|
|
101
134
|
requirements: []
|
|
102
|
-
rubygems_version: 3.
|
|
103
|
-
signing_key:
|
|
135
|
+
rubygems_version: 3.4.10
|
|
136
|
+
signing_key:
|
|
104
137
|
specification_version: 4
|
|
105
138
|
summary: Archive ActiveRecord models (and their dependents) to parallel _archive tables
|
|
106
139
|
test_files: []
|
data/Gemfile.lock
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
archive_hook (0.1.0)
|
|
5
|
-
|
|
6
|
-
GEM
|
|
7
|
-
remote: https://rubygems.org/
|
|
8
|
-
specs:
|
|
9
|
-
actioncable (6.1.4.7)
|
|
10
|
-
actionpack (= 6.1.4.7)
|
|
11
|
-
activesupport (= 6.1.4.7)
|
|
12
|
-
nio4r (~> 2.0)
|
|
13
|
-
websocket-driver (>= 0.6.1)
|
|
14
|
-
actionmailbox (6.1.4.7)
|
|
15
|
-
actionpack (= 6.1.4.7)
|
|
16
|
-
activejob (= 6.1.4.7)
|
|
17
|
-
activerecord (= 6.1.4.7)
|
|
18
|
-
activestorage (= 6.1.4.7)
|
|
19
|
-
activesupport (= 6.1.4.7)
|
|
20
|
-
mail (>= 2.7.1)
|
|
21
|
-
actionmailer (6.1.4.7)
|
|
22
|
-
actionpack (= 6.1.4.7)
|
|
23
|
-
actionview (= 6.1.4.7)
|
|
24
|
-
activejob (= 6.1.4.7)
|
|
25
|
-
activesupport (= 6.1.4.7)
|
|
26
|
-
mail (~> 2.5, >= 2.5.4)
|
|
27
|
-
rails-dom-testing (~> 2.0)
|
|
28
|
-
actionpack (6.1.4.7)
|
|
29
|
-
actionview (= 6.1.4.7)
|
|
30
|
-
activesupport (= 6.1.4.7)
|
|
31
|
-
rack (~> 2.0, >= 2.0.9)
|
|
32
|
-
rack-test (>= 0.6.3)
|
|
33
|
-
rails-dom-testing (~> 2.0)
|
|
34
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
35
|
-
actiontext (6.1.4.7)
|
|
36
|
-
actionpack (= 6.1.4.7)
|
|
37
|
-
activerecord (= 6.1.4.7)
|
|
38
|
-
activestorage (= 6.1.4.7)
|
|
39
|
-
activesupport (= 6.1.4.7)
|
|
40
|
-
nokogiri (>= 1.8.5)
|
|
41
|
-
actionview (6.1.4.7)
|
|
42
|
-
activesupport (= 6.1.4.7)
|
|
43
|
-
builder (~> 3.1)
|
|
44
|
-
erubi (~> 1.4)
|
|
45
|
-
rails-dom-testing (~> 2.0)
|
|
46
|
-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
47
|
-
activejob (6.1.4.7)
|
|
48
|
-
activesupport (= 6.1.4.7)
|
|
49
|
-
globalid (>= 0.3.6)
|
|
50
|
-
activemodel (6.1.4.7)
|
|
51
|
-
activesupport (= 6.1.4.7)
|
|
52
|
-
activerecord (6.1.4.7)
|
|
53
|
-
activemodel (= 6.1.4.7)
|
|
54
|
-
activesupport (= 6.1.4.7)
|
|
55
|
-
activestorage (6.1.4.7)
|
|
56
|
-
actionpack (= 6.1.4.7)
|
|
57
|
-
activejob (= 6.1.4.7)
|
|
58
|
-
activerecord (= 6.1.4.7)
|
|
59
|
-
activesupport (= 6.1.4.7)
|
|
60
|
-
marcel (~> 1.0.0)
|
|
61
|
-
mini_mime (>= 1.1.0)
|
|
62
|
-
activesupport (6.1.4.7)
|
|
63
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
64
|
-
i18n (>= 1.6, < 2)
|
|
65
|
-
minitest (>= 5.1)
|
|
66
|
-
tzinfo (~> 2.0)
|
|
67
|
-
zeitwerk (~> 2.3)
|
|
68
|
-
builder (3.2.4)
|
|
69
|
-
concurrent-ruby (1.2.2)
|
|
70
|
-
crass (1.0.6)
|
|
71
|
-
date (3.3.3)
|
|
72
|
-
diff-lcs (1.5.0)
|
|
73
|
-
erubi (1.12.0)
|
|
74
|
-
globalid (1.1.0)
|
|
75
|
-
activesupport (>= 5.0)
|
|
76
|
-
i18n (1.14.1)
|
|
77
|
-
concurrent-ruby (~> 1.0)
|
|
78
|
-
loofah (2.21.3)
|
|
79
|
-
crass (~> 1.0.2)
|
|
80
|
-
nokogiri (>= 1.12.0)
|
|
81
|
-
mail (2.8.1)
|
|
82
|
-
mini_mime (>= 0.1.1)
|
|
83
|
-
net-imap
|
|
84
|
-
net-pop
|
|
85
|
-
net-smtp
|
|
86
|
-
marcel (1.0.2)
|
|
87
|
-
method_source (1.0.0)
|
|
88
|
-
mini_mime (1.1.2)
|
|
89
|
-
minitest (5.18.1)
|
|
90
|
-
net-imap (0.3.6)
|
|
91
|
-
date
|
|
92
|
-
net-protocol
|
|
93
|
-
net-pop (0.1.2)
|
|
94
|
-
net-protocol
|
|
95
|
-
net-protocol (0.2.1)
|
|
96
|
-
timeout
|
|
97
|
-
net-smtp (0.3.3)
|
|
98
|
-
net-protocol
|
|
99
|
-
nio4r (2.5.9)
|
|
100
|
-
nokogiri (1.13.10-x86_64-darwin)
|
|
101
|
-
racc (~> 1.4)
|
|
102
|
-
pg (1.5.3)
|
|
103
|
-
racc (1.7.1)
|
|
104
|
-
rack (2.2.7)
|
|
105
|
-
rack-test (2.1.0)
|
|
106
|
-
rack (>= 1.3)
|
|
107
|
-
rails (6.1.4.7)
|
|
108
|
-
actioncable (= 6.1.4.7)
|
|
109
|
-
actionmailbox (= 6.1.4.7)
|
|
110
|
-
actionmailer (= 6.1.4.7)
|
|
111
|
-
actionpack (= 6.1.4.7)
|
|
112
|
-
actiontext (= 6.1.4.7)
|
|
113
|
-
actionview (= 6.1.4.7)
|
|
114
|
-
activejob (= 6.1.4.7)
|
|
115
|
-
activemodel (= 6.1.4.7)
|
|
116
|
-
activerecord (= 6.1.4.7)
|
|
117
|
-
activestorage (= 6.1.4.7)
|
|
118
|
-
activesupport (= 6.1.4.7)
|
|
119
|
-
bundler (>= 1.15.0)
|
|
120
|
-
railties (= 6.1.4.7)
|
|
121
|
-
sprockets-rails (>= 2.0.0)
|
|
122
|
-
rails-dom-testing (2.1.1)
|
|
123
|
-
activesupport (>= 5.0.0)
|
|
124
|
-
minitest
|
|
125
|
-
nokogiri (>= 1.6)
|
|
126
|
-
rails-html-sanitizer (1.5.0)
|
|
127
|
-
loofah (~> 2.19, >= 2.19.1)
|
|
128
|
-
railties (6.1.4.7)
|
|
129
|
-
actionpack (= 6.1.4.7)
|
|
130
|
-
activesupport (= 6.1.4.7)
|
|
131
|
-
method_source
|
|
132
|
-
rake (>= 0.13)
|
|
133
|
-
thor (~> 1.0)
|
|
134
|
-
rake (10.5.0)
|
|
135
|
-
rspec (3.12.0)
|
|
136
|
-
rspec-core (~> 3.12.0)
|
|
137
|
-
rspec-expectations (~> 3.12.0)
|
|
138
|
-
rspec-mocks (~> 3.12.0)
|
|
139
|
-
rspec-core (3.12.2)
|
|
140
|
-
rspec-support (~> 3.12.0)
|
|
141
|
-
rspec-expectations (3.12.3)
|
|
142
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
143
|
-
rspec-support (~> 3.12.0)
|
|
144
|
-
rspec-mocks (3.12.6)
|
|
145
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
146
|
-
rspec-support (~> 3.12.0)
|
|
147
|
-
rspec-support (3.12.1)
|
|
148
|
-
sprockets (4.2.0)
|
|
149
|
-
concurrent-ruby (~> 1.0)
|
|
150
|
-
rack (>= 2.2.4, < 4)
|
|
151
|
-
sprockets-rails (3.4.2)
|
|
152
|
-
actionpack (>= 5.2)
|
|
153
|
-
activesupport (>= 5.2)
|
|
154
|
-
sprockets (>= 3.0.0)
|
|
155
|
-
thor (1.2.2)
|
|
156
|
-
timeout (0.4.0)
|
|
157
|
-
tzinfo (2.0.6)
|
|
158
|
-
concurrent-ruby (~> 1.0)
|
|
159
|
-
websocket-driver (0.7.5)
|
|
160
|
-
websocket-extensions (>= 0.1.0)
|
|
161
|
-
websocket-extensions (0.1.5)
|
|
162
|
-
zeitwerk (2.6.8)
|
|
163
|
-
|
|
164
|
-
PLATFORMS
|
|
165
|
-
x86_64-darwin-20
|
|
166
|
-
|
|
167
|
-
DEPENDENCIES
|
|
168
|
-
archive_hook!
|
|
169
|
-
bundler (~> 2.3)
|
|
170
|
-
pg
|
|
171
|
-
rails (~> 6.1)
|
|
172
|
-
rake (~> 10.0)
|
|
173
|
-
rspec (~> 3.0)
|
|
174
|
-
|
|
175
|
-
BUNDLED WITH
|
|
176
|
-
2.3.26
|