archival_record 3.0.1 → 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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.envrc +9 -0
  3. data/.gitignore +1 -1
  4. data/.rubocop.yml +1 -1
  5. data/Appraisals +14 -0
  6. data/CHANGELOG.md +12 -2
  7. data/Gemfile.lock +67 -47
  8. data/LICENSE +1 -1
  9. data/README.md +61 -29
  10. data/archival_record.gemspec +4 -2
  11. data/gemfiles/rails_6.0.gemfile +2 -0
  12. data/gemfiles/rails_6.1.gemfile +2 -0
  13. data/gemfiles/rails_7.0.gemfile +2 -0
  14. data/gemfiles/rails_7.2.gemfile +7 -0
  15. data/gemfiles/rails_8.0.gemfile +7 -0
  16. data/lib/archival_record/version.rb +1 -1
  17. data/lib/archival_record.rb +2 -9
  18. data/lib/archival_record_core/archival_record.rb +14 -5
  19. data/lib/archival_record_core/archival_record_active_record_methods.rb +1 -3
  20. data/lib/archival_record_core/association_operation/archive.rb +0 -4
  21. data/lib/archival_record_core/association_operation/base.rb +25 -2
  22. data/shell.nix +41 -0
  23. data/test/associations_test.rb +22 -2
  24. data/test/bogus_relation_test.rb +2 -2
  25. data/test/callbacks_test.rb +14 -33
  26. data/test/exception_test.rb +9 -0
  27. data/test/fixtures/another_polys_holder.rb +1 -1
  28. data/test/fixtures/archival.rb +13 -7
  29. data/test/fixtures/archival_grandkid.rb +1 -1
  30. data/test/fixtures/archival_kid.rb +1 -1
  31. data/test/fixtures/archival_table_name.rb +1 -1
  32. data/test/fixtures/callback_archival.rb +13 -16
  33. data/test/fixtures/deprecated_warning_archival.rb +1 -1
  34. data/test/fixtures/exception_raiser.rb +11 -0
  35. data/test/fixtures/explicit_act_on_dependents_archival.rb +1 -1
  36. data/test/fixtures/exploder.rb +1 -1
  37. data/test/fixtures/ignorable_dependent.rb +1 -1
  38. data/test/fixtures/ignore_dependents_archival.rb +1 -1
  39. data/test/fixtures/independent_archival.rb +1 -1
  40. data/test/fixtures/many_many_archival.rb +9 -0
  41. data/test/fixtures/missing_archive_number.rb +1 -1
  42. data/test/fixtures/missing_archived_at.rb +1 -1
  43. data/test/fixtures/nonignorable_dependent.rb +1 -1
  44. data/test/fixtures/plain.rb +1 -1
  45. data/test/fixtures/poly.rb +1 -1
  46. data/test/fixtures/readonly_when_archived.rb +1 -1
  47. data/test/performance/the_test.rb +29 -0
  48. data/test/schema.rb +14 -12
  49. data/test/scope_test.rb +2 -2
  50. data/test/test_helper.rb +19 -5
  51. metadata +44 -11
  52. data/.gitlab-ci.yml +0 -20
  53. data/test/application_record_test.rb +0 -20
  54. data/test/fixtures/application_record_row.rb +0 -8
  55. /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: 3.0.1
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: '2'
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: '2'
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,8 +220,9 @@ 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/application_record_test.rb
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
@@ -200,9 +231,8 @@ files:
200
231
  - test/column_test.rb
201
232
  - test/deep_nesting_test.rb
202
233
  - test/deprecated_warning_archival_test.rb
234
+ - test/exception_test.rb
203
235
  - test/fixtures/another_polys_holder.rb
204
- - test/fixtures/application_record.rb
205
- - test/fixtures/application_record_row.rb
206
236
  - test/fixtures/archival.rb
207
237
  - test/fixtures/archival_grandkid.rb
208
238
  - test/fixtures/archival_kid.rb
@@ -210,17 +240,20 @@ files:
210
240
  - test/fixtures/bogus_relation.rb
211
241
  - test/fixtures/callback_archival.rb
212
242
  - test/fixtures/deprecated_warning_archival.rb
243
+ - test/fixtures/exception_raiser.rb
213
244
  - test/fixtures/explicit_act_on_dependents_archival.rb
214
245
  - test/fixtures/exploder.rb
215
246
  - test/fixtures/ignorable_dependent.rb
216
247
  - test/fixtures/ignore_dependents_archival.rb
217
248
  - test/fixtures/independent_archival.rb
249
+ - test/fixtures/many_many_archival.rb
218
250
  - test/fixtures/missing_archive_number.rb
219
251
  - test/fixtures/missing_archived_at.rb
220
252
  - test/fixtures/nonignorable_dependent.rb
221
253
  - test/fixtures/plain.rb
222
254
  - test/fixtures/poly.rb
223
255
  - test/fixtures/readonly_when_archived.rb
256
+ - test/performance/the_test.rb
224
257
  - test/polymorphic_test.rb
225
258
  - test/readonly_when_archived_test.rb
226
259
  - test/relations_test.rb
@@ -230,7 +263,7 @@ files:
230
263
  - test/test_helper.rb
231
264
  - test/through_association_test.rb
232
265
  - test/transaction_test.rb
233
- homepage: https://gitlab.com/joelmeador/archival_record/
266
+ homepage: https://codeberg.org/joelmeador/archival_record/
234
267
  licenses:
235
268
  - MIT
236
269
  metadata:
@@ -250,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
283
  - !ruby/object:Gem::Version
251
284
  version: '0'
252
285
  requirements: []
253
- rubygems_version: 3.4.22
286
+ rubygems_version: 3.5.22
254
287
  signing_key:
255
288
  specification_version: 4
256
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,8 +0,0 @@
1
- # Rails 5 introduced a new base class, and this is gonna be used in the tests of that
2
- if defined?(ApplicationRecord)
3
- class ApplicationRecordRow < ApplicationRecord
4
-
5
- archival_record
6
-
7
- end
8
- end