archival_record 3.0.0 → 4.0.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 +4 -4
- data/.envrc +9 -0
- data/.gitignore +1 -1
- data/.rubocop.yml +1 -1
- data/Appraisals +14 -0
- data/CHANGELOG.md +16 -2
- data/Gemfile.lock +67 -47
- data/LICENSE +1 -1
- data/README.md +63 -31
- data/archival_record.gemspec +5 -3
- data/gemfiles/rails_6.0.gemfile +2 -0
- data/gemfiles/rails_6.1.gemfile +2 -0
- data/gemfiles/rails_7.0.gemfile +2 -0
- data/gemfiles/rails_7.2.gemfile +7 -0
- data/gemfiles/rails_8.0.gemfile +7 -0
- data/lib/archival_record/version.rb +1 -1
- data/lib/archival_record.rb +2 -9
- data/lib/archival_record_core/archival_record.rb +21 -8
- data/lib/archival_record_core/archival_record_active_record_methods.rb +1 -3
- data/lib/archival_record_core/association_operation/archive.rb +0 -4
- data/lib/archival_record_core/association_operation/base.rb +25 -2
- data/shell.nix +41 -0
- data/test/associations_test.rb +22 -2
- data/test/bogus_relation_test.rb +22 -0
- data/test/callbacks_test.rb +14 -33
- data/test/exception_test.rb +9 -0
- data/test/fixtures/another_polys_holder.rb +1 -1
- data/test/fixtures/archival.rb +13 -7
- data/test/fixtures/archival_grandkid.rb +1 -1
- data/test/fixtures/archival_kid.rb +1 -1
- data/test/fixtures/archival_table_name.rb +1 -1
- data/test/fixtures/bogus_relation.rb +6 -0
- data/test/fixtures/{callback_archival4.rb → callback_archival.rb} +3 -2
- data/test/fixtures/deprecated_warning_archival.rb +1 -1
- data/test/fixtures/exception_raiser.rb +11 -0
- data/test/fixtures/explicit_act_on_dependents_archival.rb +1 -1
- data/test/fixtures/exploder.rb +1 -1
- data/test/fixtures/ignorable_dependent.rb +1 -1
- data/test/fixtures/ignore_dependents_archival.rb +1 -1
- data/test/fixtures/independent_archival.rb +1 -1
- data/test/fixtures/many_many_archival.rb +9 -0
- data/test/fixtures/missing_archive_number.rb +1 -1
- data/test/fixtures/missing_archived_at.rb +1 -1
- data/test/fixtures/nonignorable_dependent.rb +1 -1
- data/test/fixtures/plain.rb +1 -1
- data/test/fixtures/poly.rb +1 -1
- data/test/fixtures/readonly_when_archived.rb +1 -1
- data/test/performance/the_test.rb +29 -0
- data/test/schema.rb +19 -12
- data/test/scope_test.rb +3 -9
- data/test/test_helper.rb +30 -29
- metadata +47 -13
- data/.gitlab-ci.yml +0 -20
- data/test/application_record_test.rb +0 -20
- data/test/fixtures/application_record_row.rb +0 -8
- data/test/fixtures/callback_archival5.rb +0 -23
- /data/test/{fixtures/application_record.rb → application_record.rb} +0 -0
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archival_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Meador
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '6.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activejob
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '6.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '6.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: appraisal
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,20 @@ dependencies:
|
|
66
80
|
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: rake
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,16 +168,16 @@ dependencies:
|
|
140
168
|
name: sqlite3
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
|
-
- - "
|
171
|
+
- - ">="
|
144
172
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
173
|
+
version: '0'
|
146
174
|
type: :development
|
147
175
|
prerelease: false
|
148
176
|
version_requirements: !ruby/object:Gem::Requirement
|
149
177
|
requirements:
|
150
|
-
- - "
|
178
|
+
- - ">="
|
151
179
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
180
|
+
version: '0'
|
153
181
|
description: |
|
154
182
|
*Atomic archiving/unarchiving for ActiveRecord*
|
155
183
|
|
@@ -164,8 +192,8 @@ executables: []
|
|
164
192
|
extensions: []
|
165
193
|
extra_rdoc_files: []
|
166
194
|
files:
|
195
|
+
- ".envrc"
|
167
196
|
- ".gitignore"
|
168
|
-
- ".gitlab-ci.yml"
|
169
197
|
- ".rubocop.yml"
|
170
198
|
- ".rubocop_todo.yml"
|
171
199
|
- Appraisals
|
@@ -181,6 +209,8 @@ files:
|
|
181
209
|
- gemfiles/rails_6.1.gemfile
|
182
210
|
- gemfiles/rails_7.0.gemfile
|
183
211
|
- gemfiles/rails_7.1.gemfile
|
212
|
+
- gemfiles/rails_7.2.gemfile
|
213
|
+
- gemfiles/rails_8.0.gemfile
|
184
214
|
- init.rb
|
185
215
|
- lib/archival_record.rb
|
186
216
|
- lib/archival_record/version.rb
|
@@ -190,36 +220,40 @@ files:
|
|
190
220
|
- lib/archival_record_core/association_operation/base.rb
|
191
221
|
- lib/archival_record_core/association_operation/unarchive.rb
|
192
222
|
- script/setup
|
223
|
+
- shell.nix
|
193
224
|
- test/ambiguous_table_test.rb
|
194
|
-
- test/
|
225
|
+
- test/application_record.rb
|
195
226
|
- test/archive_dependents_option_test.rb
|
196
227
|
- test/associations_test.rb
|
197
228
|
- test/basic_test.rb
|
229
|
+
- test/bogus_relation_test.rb
|
198
230
|
- test/callbacks_test.rb
|
199
231
|
- test/column_test.rb
|
200
232
|
- test/deep_nesting_test.rb
|
201
233
|
- test/deprecated_warning_archival_test.rb
|
234
|
+
- test/exception_test.rb
|
202
235
|
- test/fixtures/another_polys_holder.rb
|
203
|
-
- test/fixtures/application_record.rb
|
204
|
-
- test/fixtures/application_record_row.rb
|
205
236
|
- test/fixtures/archival.rb
|
206
237
|
- test/fixtures/archival_grandkid.rb
|
207
238
|
- test/fixtures/archival_kid.rb
|
208
239
|
- test/fixtures/archival_table_name.rb
|
209
|
-
- test/fixtures/
|
210
|
-
- test/fixtures/
|
240
|
+
- test/fixtures/bogus_relation.rb
|
241
|
+
- test/fixtures/callback_archival.rb
|
211
242
|
- test/fixtures/deprecated_warning_archival.rb
|
243
|
+
- test/fixtures/exception_raiser.rb
|
212
244
|
- test/fixtures/explicit_act_on_dependents_archival.rb
|
213
245
|
- test/fixtures/exploder.rb
|
214
246
|
- test/fixtures/ignorable_dependent.rb
|
215
247
|
- test/fixtures/ignore_dependents_archival.rb
|
216
248
|
- test/fixtures/independent_archival.rb
|
249
|
+
- test/fixtures/many_many_archival.rb
|
217
250
|
- test/fixtures/missing_archive_number.rb
|
218
251
|
- test/fixtures/missing_archived_at.rb
|
219
252
|
- test/fixtures/nonignorable_dependent.rb
|
220
253
|
- test/fixtures/plain.rb
|
221
254
|
- test/fixtures/poly.rb
|
222
255
|
- test/fixtures/readonly_when_archived.rb
|
256
|
+
- test/performance/the_test.rb
|
223
257
|
- test/polymorphic_test.rb
|
224
258
|
- test/readonly_when_archived_test.rb
|
225
259
|
- test/relations_test.rb
|
@@ -229,7 +263,7 @@ files:
|
|
229
263
|
- test/test_helper.rb
|
230
264
|
- test/through_association_test.rb
|
231
265
|
- test/transaction_test.rb
|
232
|
-
homepage: https://
|
266
|
+
homepage: https://codeberg.org/joelmeador/archival_record/
|
233
267
|
licenses:
|
234
268
|
- MIT
|
235
269
|
metadata:
|
@@ -249,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
283
|
- !ruby/object:Gem::Version
|
250
284
|
version: '0'
|
251
285
|
requirements: []
|
252
|
-
rubygems_version: 3.
|
286
|
+
rubygems_version: 3.5.22
|
253
287
|
signing_key:
|
254
288
|
specification_version: 4
|
255
289
|
summary: Atomic archiving/unarchiving for ActiveRecord
|
data/.gitlab-ci.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
image: "ruby:3.2"
|
2
|
-
|
3
|
-
before_script:
|
4
|
-
- apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs
|
5
|
-
- ruby -v
|
6
|
-
- which ruby
|
7
|
-
- gem install bundler --no-document
|
8
|
-
- bundle install --jobs $(nproc) "${FLAGS[@]}"
|
9
|
-
- bundle install --gemfile=gemfiles/rails_6.0.gemfile
|
10
|
-
- bundle install --gemfile=gemfiles/rails_6.1.gemfile
|
11
|
-
- bundle install --gemfile=gemfiles/rails_7.0.gemfile
|
12
|
-
- bundle install --gemfile=gemfiles/rails_7.1.gemfile
|
13
|
-
|
14
|
-
rake:
|
15
|
-
script:
|
16
|
-
- bundle exec rake
|
17
|
-
|
18
|
-
appraisal:
|
19
|
-
script:
|
20
|
-
- bundle exec appraisal rake
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require_relative "test_helper"
|
2
|
-
|
3
|
-
# Rails 5 introduced a new base class, and this is gonna test that
|
4
|
-
if defined?(ApplicationRecord)
|
5
|
-
class ApplicationRecordTest < ActiveSupport::TestCase
|
6
|
-
|
7
|
-
test "archive archives the record" do
|
8
|
-
archival = ApplicationRecordRow.create!
|
9
|
-
archival.archive!
|
10
|
-
assert archival.reload.archived?
|
11
|
-
end
|
12
|
-
|
13
|
-
test "unarchive unarchives archival records" do
|
14
|
-
archival = ApplicationRecordRow.create!(archived_at: Time.now.utc, archive_number: 1)
|
15
|
-
archival.unarchive!
|
16
|
-
assert_not archival.reload.archived?
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# necessary for ApplicationRecord
|
2
|
-
if defined?(ApplicationRecord)
|
3
|
-
class CallbackArchival5 < ApplicationRecord
|
4
|
-
|
5
|
-
archival_record
|
6
|
-
|
7
|
-
attr_accessor :set_this_value,
|
8
|
-
:pass_callback
|
9
|
-
|
10
|
-
before_archive :set_value,
|
11
|
-
:conditional_callback_passer
|
12
|
-
|
13
|
-
private def set_value
|
14
|
-
self.settable_field = set_this_value
|
15
|
-
end
|
16
|
-
|
17
|
-
private def conditional_callback_passer
|
18
|
-
# we want to throw only for the value false
|
19
|
-
throw(:abort) unless pass_callback || pass_callback.nil?
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
File without changes
|