acts_as_archival 2.0.0 → 2.1.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/.gitignore +1 -0
- data/.rubocop.yml +2 -1
- data/Appraisals +4 -9
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +29 -28
- data/acts_as_archival.gemspec +6 -4
- data/gemfiles/{rails_6.0.gemfile → rails_7.0.gemfile} +1 -1
- data/lib/acts_as_archival/version.rb +1 -1
- data/lib/expected_behavior/acts_as_archival.rb +12 -11
- data/test/callbacks_test.rb +14 -33
- data/test/fixtures/{callback_archival_4.rb → callback_archival.rb} +7 -4
- data/test/schema.rb +1 -7
- data/test/scope_test.rb +4 -8
- data/test/test_helper.rb +8 -20
- metadata +15 -47
- data/gemfiles/rails_5.2.gemfile +0 -8
- data/test/fixtures/callback_archival_5.rb +0 -23
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ebfd9690765e2b7676db8c90e2459ccccf3ff2ef9f6b94898fafa565cfdc708a
|
|
4
|
+
data.tar.gz: 303ee5fb63bd23c6bc35ef69b23eab80c455acd75632e3ca41a03b378fb3a471
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d559c3b334d403418304225720db0b4cc78517bc4fd7fd43d6e3cb0bae8704c7f7e05288202658bec3d1622395e76583d538dca5ba942fbb4108a77060e19988
|
|
7
|
+
data.tar.gz: 1e64b71d7f09a82d38e68abb807c36a70f7ce6fe577ec45047a1f1cfb6cf466280634fae78acfb4c83f9b81a9a801a68c79095cd2f5102dc7e28ab9cf6eb1716
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
appraise "rails-5.2" do
|
|
2
|
-
gem "rails", "~> 5.2.0"
|
|
3
|
-
gem "sqlite3", "~> 1.4.1"
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
appraise "rails-6.0" do
|
|
7
|
-
gem "rails", "~> 6.0.0"
|
|
8
|
-
end
|
|
9
|
-
|
|
10
1
|
appraise "rails-6.1" do
|
|
11
2
|
gem "rails", "~> 6.1"
|
|
12
3
|
end
|
|
4
|
+
|
|
5
|
+
appraise "rails-7.0" do
|
|
6
|
+
gem "rails", "~> 7.0"
|
|
7
|
+
end
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
## 2.
|
|
3
|
+
## 2.1.0
|
|
4
|
+
* **BREAKING CHANGE** Drop support for Rails 5.2 and 6.0 (6.1 support remains)
|
|
5
|
+
* Add support for Rails 7
|
|
6
|
+
* Fix deprecation warnings
|
|
7
|
+
* Need Ruby >=2.7 for Rails 7 support
|
|
8
|
+
|
|
9
|
+
## 2.0.0
|
|
4
10
|
|
|
5
11
|
* **BREAKING CHANGE** Drop support for Rails 4.2
|
|
6
12
|
* **BREAKING CHANGE** Drop support for Rails 5.0
|
data/Gemfile.lock
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
acts_as_archival (2.
|
|
5
|
-
activerecord (>=
|
|
4
|
+
acts_as_archival (2.1.0)
|
|
5
|
+
activerecord (>= 6.1)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activemodel (
|
|
11
|
-
activesupport (=
|
|
12
|
-
activerecord (
|
|
13
|
-
activemodel (=
|
|
14
|
-
activesupport (=
|
|
15
|
-
activesupport (
|
|
10
|
+
activemodel (7.0.3)
|
|
11
|
+
activesupport (= 7.0.3)
|
|
12
|
+
activerecord (7.0.3)
|
|
13
|
+
activemodel (= 7.0.3)
|
|
14
|
+
activesupport (= 7.0.3)
|
|
15
|
+
activesupport (7.0.3)
|
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
17
17
|
i18n (>= 1.6, < 2)
|
|
18
18
|
minitest (>= 5.1)
|
|
19
19
|
tzinfo (~> 2.0)
|
|
20
|
-
zeitwerk (~> 2.3)
|
|
21
20
|
appraisal (2.2.0)
|
|
22
21
|
bundler
|
|
23
22
|
rake
|
|
24
23
|
thor (>= 0.14.0)
|
|
25
24
|
assertions-eb (1.7.3)
|
|
26
|
-
ast (2.4.
|
|
27
|
-
concurrent-ruby (1.1.
|
|
25
|
+
ast (2.4.2)
|
|
26
|
+
concurrent-ruby (1.1.10)
|
|
28
27
|
database_cleaner (1.8.4)
|
|
29
|
-
i18n (1.
|
|
28
|
+
i18n (1.10.0)
|
|
30
29
|
concurrent-ruby (~> 1.0)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
rainbow (3.0.0)
|
|
30
|
+
minitest (5.16.1)
|
|
31
|
+
parallel (1.22.1)
|
|
32
|
+
parser (3.1.2.0)
|
|
33
|
+
ast (~> 2.4.1)
|
|
34
|
+
rainbow (3.1.1)
|
|
37
35
|
rake (13.0.1)
|
|
38
|
-
|
|
36
|
+
regexp_parser (2.5.0)
|
|
37
|
+
rexml (3.2.5)
|
|
39
38
|
rr (1.2.1)
|
|
40
|
-
rubocop (
|
|
41
|
-
jaro_winkler (~> 1.5.1)
|
|
39
|
+
rubocop (1.30.1)
|
|
42
40
|
parallel (~> 1.10)
|
|
43
|
-
parser (>=
|
|
41
|
+
parser (>= 3.1.0.0)
|
|
44
42
|
rainbow (>= 2.2.2, < 4.0)
|
|
45
|
-
|
|
43
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
44
|
+
rexml (>= 3.2.5, < 4.0)
|
|
45
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
|
46
46
|
ruby-progressbar (~> 1.7)
|
|
47
|
-
unicode-display_width (>= 1.4.0, <
|
|
48
|
-
|
|
47
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
48
|
+
rubocop-ast (1.18.0)
|
|
49
|
+
parser (>= 3.1.1.0)
|
|
50
|
+
ruby-progressbar (1.11.0)
|
|
49
51
|
sqlite3 (1.4.2)
|
|
50
52
|
thor (1.0.1)
|
|
51
53
|
tzinfo (2.0.4)
|
|
52
54
|
concurrent-ruby (~> 1.0)
|
|
53
|
-
unicode-display_width (1.
|
|
54
|
-
zeitwerk (2.4.2)
|
|
55
|
+
unicode-display_width (2.1.0)
|
|
55
56
|
|
|
56
57
|
PLATFORMS
|
|
57
58
|
ruby
|
|
@@ -63,7 +64,7 @@ DEPENDENCIES
|
|
|
63
64
|
database_cleaner
|
|
64
65
|
rake
|
|
65
66
|
rr
|
|
66
|
-
rubocop (~>
|
|
67
|
+
rubocop (~> 1.30.1)
|
|
67
68
|
sqlite3
|
|
68
69
|
|
|
69
70
|
BUNDLED WITH
|
data/acts_as_archival.gemspec
CHANGED
|
@@ -5,6 +5,7 @@ require "acts_as_archival/version"
|
|
|
5
5
|
Gem::Specification.new do |gem|
|
|
6
6
|
gem.name = "acts_as_archival"
|
|
7
7
|
gem.summary = "Atomic archiving/unarchiving for ActiveRecord-based apps"
|
|
8
|
+
gem.licenses = ['MIT']
|
|
8
9
|
gem.version = ActsAsArchival::VERSION
|
|
9
10
|
gem.authors = ["Joel Meador",
|
|
10
11
|
"Michael Kuehl",
|
|
@@ -26,19 +27,20 @@ Gem::Specification.new do |gem|
|
|
|
26
27
|
"nathan@expectedbehavior.com"]
|
|
27
28
|
gem.homepage = "http://github.com/expectedbehavior/acts_as_archival"
|
|
28
29
|
|
|
30
|
+
gem.metadata["rubygems_mfa_required"] = "true"
|
|
31
|
+
|
|
29
32
|
gem.files = `git ls-files`.split("\n")
|
|
30
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
31
33
|
gem.require_paths = ["lib"]
|
|
32
|
-
gem.required_ruby_version = ">= 2.
|
|
34
|
+
gem.required_ruby_version = ">= 2.7.3"
|
|
33
35
|
|
|
34
|
-
gem.add_dependency "activerecord", ">=
|
|
36
|
+
gem.add_dependency "activerecord", ">= 6.1"
|
|
35
37
|
|
|
36
38
|
gem.add_development_dependency "appraisal"
|
|
37
39
|
gem.add_development_dependency "assertions-eb"
|
|
38
40
|
gem.add_development_dependency "database_cleaner"
|
|
39
41
|
gem.add_development_dependency "rake"
|
|
40
42
|
gem.add_development_dependency "rr"
|
|
41
|
-
gem.add_development_dependency "rubocop", "~>
|
|
43
|
+
gem.add_development_dependency "rubocop", "~> 1.30.1"
|
|
42
44
|
gem.add_development_dependency "sqlite3"
|
|
43
45
|
|
|
44
46
|
gem.description =
|
|
@@ -3,13 +3,13 @@ module ExpectedBehavior
|
|
|
3
3
|
|
|
4
4
|
require "digest/md5"
|
|
5
5
|
|
|
6
|
-
unless defined?(MissingArchivalColumnError) == "constant" && MissingArchivalColumnError.
|
|
6
|
+
unless defined?(MissingArchivalColumnError) == "constant" && MissingArchivalColumnError.instance_of?(Class)
|
|
7
7
|
MissingArchivalColumnError = Class.new(ActiveRecord::ActiveRecordError)
|
|
8
8
|
end
|
|
9
|
-
unless defined?(CouldNotArchiveError) == "constant" && CouldNotArchiveError.
|
|
9
|
+
unless defined?(CouldNotArchiveError) == "constant" && CouldNotArchiveError.instance_of?(Class)
|
|
10
10
|
CouldNotArchiveError = Class.new(ActiveRecord::ActiveRecordError)
|
|
11
11
|
end
|
|
12
|
-
unless defined?(CouldNotUnarchiveError) == "constant" && CouldNotUnarchiveError.
|
|
12
|
+
unless defined?(CouldNotUnarchiveError) == "constant" && CouldNotUnarchiveError.instance_of?(Class)
|
|
13
13
|
CouldNotUnarchiveError = Class.new(ActiveRecord::ActiveRecordError)
|
|
14
14
|
end
|
|
15
15
|
|
|
@@ -66,6 +66,7 @@ module ExpectedBehavior
|
|
|
66
66
|
|
|
67
67
|
private def define_callback_dsl_method(callbackable_type, action)
|
|
68
68
|
# rubocop:disable Security/Eval
|
|
69
|
+
# rubocop:disable Style/DocumentDynamicEvalDefinition
|
|
69
70
|
eval <<-end_callbacks
|
|
70
71
|
unless defined?(#{callbackable_type}_#{action})
|
|
71
72
|
def #{callbackable_type}_#{action}(*args, &blk)
|
|
@@ -73,6 +74,7 @@ module ExpectedBehavior
|
|
|
73
74
|
end
|
|
74
75
|
end
|
|
75
76
|
end_callbacks
|
|
77
|
+
# rubocop:enable Style/DocumentDynamicEvalDefinition
|
|
76
78
|
# rubocop:enable Security/Eval
|
|
77
79
|
end
|
|
78
80
|
|
|
@@ -132,16 +134,15 @@ module ExpectedBehavior
|
|
|
132
134
|
AssociationOperation::Unarchive.new(self, head_archive_number).execute
|
|
133
135
|
end
|
|
134
136
|
|
|
135
|
-
private def execute_archival_action(action)
|
|
137
|
+
private def execute_archival_action(action, &block)
|
|
138
|
+
result = false
|
|
136
139
|
self.class.transaction do
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
rescue => e
|
|
141
|
-
handle_archival_action_exception(e)
|
|
142
|
-
end
|
|
140
|
+
result = !!run_callbacks(action, &block)
|
|
141
|
+
rescue => e
|
|
142
|
+
handle_archival_action_exception(e)
|
|
143
143
|
end
|
|
144
|
-
|
|
144
|
+
|
|
145
|
+
result
|
|
145
146
|
end
|
|
146
147
|
|
|
147
148
|
private def handle_archival_action_exception(exception)
|
data/test/callbacks_test.rb
CHANGED
|
@@ -2,40 +2,21 @@ require_relative "test_helper"
|
|
|
2
2
|
|
|
3
3
|
class CallbacksTest < ActiveSupport::TestCase
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
test "can be halted" do
|
|
15
|
-
archival = CallbackArchival5.create
|
|
16
|
-
archival.set_this_value = "a test string"
|
|
17
|
-
archival.pass_callback = false
|
|
18
|
-
assert_nil archival.settable_field
|
|
19
|
-
archival.archive!
|
|
20
|
-
assert_nil archival.reload.settable_field
|
|
21
|
-
end
|
|
22
|
-
else
|
|
23
|
-
test "can set a value as part of archiving" do
|
|
24
|
-
archival = CallbackArchival4.create
|
|
25
|
-
archival.set_this_value = "a test string"
|
|
26
|
-
assert_nil archival.settable_field
|
|
27
|
-
archival.archive!
|
|
28
|
-
assert_equal "a test string", archival.reload.settable_field
|
|
29
|
-
end
|
|
5
|
+
test "can set a value as part of archiving" do
|
|
6
|
+
archival = CallbackArchival.create
|
|
7
|
+
archival.set_this_value = "a test string"
|
|
8
|
+
assert_nil archival.settable_field
|
|
9
|
+
archival.archive!
|
|
10
|
+
assert_equal "a test string", archival.reload.settable_field
|
|
11
|
+
end
|
|
30
12
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
end
|
|
13
|
+
test "can be halted" do
|
|
14
|
+
archival = CallbackArchival.create
|
|
15
|
+
archival.set_this_value = "a test string"
|
|
16
|
+
archival.pass_callback = false
|
|
17
|
+
assert_nil archival.settable_field
|
|
18
|
+
archival.archive!
|
|
19
|
+
assert_nil archival.reload.settable_field
|
|
39
20
|
end
|
|
40
21
|
|
|
41
22
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class CallbackArchival < ApplicationRecord
|
|
2
2
|
|
|
3
3
|
acts_as_archival
|
|
4
4
|
|
|
@@ -8,12 +8,15 @@ class CallbackArchival4 < ActiveRecord::Base
|
|
|
8
8
|
before_archive :set_value,
|
|
9
9
|
:conditional_callback_passer
|
|
10
10
|
|
|
11
|
-
private
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def set_value
|
|
12
14
|
self.settable_field = set_this_value
|
|
13
15
|
end
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
def conditional_callback_passer
|
|
18
|
+
# we want to throw only for the value false
|
|
19
|
+
throw(:abort) unless pass_callback || pass_callback.nil?
|
|
17
20
|
end
|
|
18
21
|
|
|
19
22
|
end
|
data/test/schema.rb
CHANGED
|
@@ -76,13 +76,7 @@ ActiveRecord::Schema.define(version: 1) do
|
|
|
76
76
|
t.column :archived_at, :datetime
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
-
create_table :
|
|
80
|
-
t.column :settable_field, :string
|
|
81
|
-
t.column :archive_number, :string
|
|
82
|
-
t.column :archived_at, :datetime
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
create_table :callback_archival5s, force: true do |t|
|
|
79
|
+
create_table :callback_archivals, force: true do |t|
|
|
86
80
|
t.column :settable_field, :string
|
|
87
81
|
t.column :archive_number, :string
|
|
88
82
|
t.column :archived_at, :datetime
|
data/test/scope_test.rb
CHANGED
|
@@ -52,15 +52,11 @@ class ScopeTest < ActiveSupport::TestCase
|
|
|
52
52
|
|
|
53
53
|
test "table_name is set to 'legacy'" do
|
|
54
54
|
archived_sql =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
else
|
|
59
|
-
"SELECT \"legacy\".* FROM \"legacy\" " \
|
|
60
|
-
'WHERE ("legacy"."archived_at" IS NOT NULL) AND ("legacy"."archive_number" IS NOT NULL)'
|
|
61
|
-
end
|
|
55
|
+
"SELECT \"legacy\".* FROM \"legacy\" " \
|
|
56
|
+
'WHERE "legacy"."archived_at" IS NOT NULL AND "legacy"."archive_number" IS NOT NULL'
|
|
57
|
+
|
|
62
58
|
unarchived_sql = "SELECT \"legacy\".* FROM \"legacy\" " \
|
|
63
|
-
|
|
59
|
+
'WHERE "legacy"."archived_at" IS NULL AND "legacy"."archive_number" IS NULL'
|
|
64
60
|
assert_equal archived_sql, ArchivalTableName.archived.to_sql
|
|
65
61
|
assert_equal unarchived_sql, ArchivalTableName.unarchived.to_sql
|
|
66
62
|
end
|
data/test/test_helper.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__)
|
|
1
|
+
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib")
|
|
2
2
|
require "bundler/setup"
|
|
3
3
|
require "minitest/autorun"
|
|
4
4
|
require "minitest/pride"
|
|
@@ -22,7 +22,7 @@ end
|
|
|
22
22
|
|
|
23
23
|
def setup_logging
|
|
24
24
|
require "logger"
|
|
25
|
-
logfile = File.dirname(__FILE__)
|
|
25
|
+
logfile = "#{File.dirname(__FILE__)}/debug.log"
|
|
26
26
|
ActiveRecord::Base.logger = Logger.new(logfile)
|
|
27
27
|
end
|
|
28
28
|
|
|
@@ -43,7 +43,7 @@ def sqlite_config
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def create_test_tables
|
|
46
|
-
schema_file = File.dirname(__FILE__)
|
|
46
|
+
schema_file = "#{File.dirname(__FILE__)}/schema.rb"
|
|
47
47
|
puts "** Loading schema for SQLite"
|
|
48
48
|
ActiveRecord::Base.establish_connection(sqlite_config)
|
|
49
49
|
load(schema_file) if File.exist?(schema_file)
|
|
@@ -61,17 +61,10 @@ BASE_FIXTURE_CLASSES = [
|
|
|
61
61
|
:missing_archive_number,
|
|
62
62
|
:plain,
|
|
63
63
|
:poly,
|
|
64
|
-
:readonly_when_archived
|
|
65
|
-
].freeze
|
|
66
|
-
|
|
67
|
-
RAILS_4_FIXTURE_CLASSES = [
|
|
68
|
-
:callback_archival_4
|
|
69
|
-
].freeze
|
|
70
|
-
|
|
71
|
-
RAILS_5_FIXTURE_CLASSES = [
|
|
64
|
+
:readonly_when_archived,
|
|
72
65
|
:application_record,
|
|
73
66
|
:application_record_row,
|
|
74
|
-
:
|
|
67
|
+
:callback_archival
|
|
75
68
|
].freeze
|
|
76
69
|
|
|
77
70
|
def require_test_classes
|
|
@@ -79,14 +72,9 @@ def require_test_classes
|
|
|
79
72
|
inflect.irregular "poly", "polys"
|
|
80
73
|
end
|
|
81
74
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
RAILS_4_FIXTURE_CLASSES
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
fixtures += BASE_FIXTURE_CLASSES
|
|
89
|
-
fixtures.each { |test_class_file| require_relative "fixtures/#{test_class_file}" }
|
|
75
|
+
BASE_FIXTURE_CLASSES.each do |test_class_file|
|
|
76
|
+
require_relative "fixtures/#{test_class_file}"
|
|
77
|
+
end
|
|
90
78
|
end
|
|
91
79
|
|
|
92
80
|
prepare_for_tests
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: acts_as_archival
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joel Meador
|
|
@@ -21,7 +21,7 @@ authors:
|
|
|
21
21
|
autorequire:
|
|
22
22
|
bindir: bin
|
|
23
23
|
cert_chain: []
|
|
24
|
-
date:
|
|
24
|
+
date: 2022-06-21 00:00:00.000000000 Z
|
|
25
25
|
dependencies:
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: activerecord
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '6.1'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '6.1'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: appraisal
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -113,14 +113,14 @@ dependencies:
|
|
|
113
113
|
requirements:
|
|
114
114
|
- - "~>"
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version:
|
|
116
|
+
version: 1.30.1
|
|
117
117
|
type: :development
|
|
118
118
|
prerelease: false
|
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - "~>"
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version:
|
|
123
|
+
version: 1.30.1
|
|
124
124
|
- !ruby/object:Gem::Dependency
|
|
125
125
|
name: sqlite3
|
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -170,9 +170,8 @@ files:
|
|
|
170
170
|
- README.md
|
|
171
171
|
- Rakefile
|
|
172
172
|
- acts_as_archival.gemspec
|
|
173
|
-
- gemfiles/rails_5.2.gemfile
|
|
174
|
-
- gemfiles/rails_6.0.gemfile
|
|
175
173
|
- gemfiles/rails_6.1.gemfile
|
|
174
|
+
- gemfiles/rails_7.0.gemfile
|
|
176
175
|
- init.rb
|
|
177
176
|
- lib/acts_as_archival.rb
|
|
178
177
|
- lib/acts_as_archival/version.rb
|
|
@@ -196,8 +195,7 @@ files:
|
|
|
196
195
|
- test/fixtures/archival_grandkid.rb
|
|
197
196
|
- test/fixtures/archival_kid.rb
|
|
198
197
|
- test/fixtures/archival_table_name.rb
|
|
199
|
-
- test/fixtures/
|
|
200
|
-
- test/fixtures/callback_archival_5.rb
|
|
198
|
+
- test/fixtures/callback_archival.rb
|
|
201
199
|
- test/fixtures/exploder.rb
|
|
202
200
|
- test/fixtures/independent_archival.rb
|
|
203
201
|
- test/fixtures/missing_archive_number.rb
|
|
@@ -215,8 +213,10 @@ files:
|
|
|
215
213
|
- test/through_association_test.rb
|
|
216
214
|
- test/transaction_test.rb
|
|
217
215
|
homepage: http://github.com/expectedbehavior/acts_as_archival
|
|
218
|
-
licenses:
|
|
219
|
-
|
|
216
|
+
licenses:
|
|
217
|
+
- MIT
|
|
218
|
+
metadata:
|
|
219
|
+
rubygems_mfa_required: 'true'
|
|
220
220
|
post_install_message:
|
|
221
221
|
rdoc_options: []
|
|
222
222
|
require_paths:
|
|
@@ -225,47 +225,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
225
225
|
requirements:
|
|
226
226
|
- - ">="
|
|
227
227
|
- !ruby/object:Gem::Version
|
|
228
|
-
version:
|
|
228
|
+
version: 2.7.3
|
|
229
229
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
requirements:
|
|
231
231
|
- - ">="
|
|
232
232
|
- !ruby/object:Gem::Version
|
|
233
233
|
version: '0'
|
|
234
234
|
requirements: []
|
|
235
|
-
rubygems_version: 3.
|
|
235
|
+
rubygems_version: 3.3.3
|
|
236
236
|
signing_key:
|
|
237
237
|
specification_version: 4
|
|
238
238
|
summary: Atomic archiving/unarchiving for ActiveRecord-based apps
|
|
239
|
-
test_files:
|
|
240
|
-
- test/ambiguous_table_test.rb
|
|
241
|
-
- test/application_record_test.rb
|
|
242
|
-
- test/associations_test.rb
|
|
243
|
-
- test/basic_test.rb
|
|
244
|
-
- test/callbacks_test.rb
|
|
245
|
-
- test/column_test.rb
|
|
246
|
-
- test/deep_nesting_test.rb
|
|
247
|
-
- test/fixtures/another_polys_holder.rb
|
|
248
|
-
- test/fixtures/application_record.rb
|
|
249
|
-
- test/fixtures/application_record_row.rb
|
|
250
|
-
- test/fixtures/archival.rb
|
|
251
|
-
- test/fixtures/archival_grandkid.rb
|
|
252
|
-
- test/fixtures/archival_kid.rb
|
|
253
|
-
- test/fixtures/archival_table_name.rb
|
|
254
|
-
- test/fixtures/callback_archival_4.rb
|
|
255
|
-
- test/fixtures/callback_archival_5.rb
|
|
256
|
-
- test/fixtures/exploder.rb
|
|
257
|
-
- test/fixtures/independent_archival.rb
|
|
258
|
-
- test/fixtures/missing_archive_number.rb
|
|
259
|
-
- test/fixtures/missing_archived_at.rb
|
|
260
|
-
- test/fixtures/plain.rb
|
|
261
|
-
- test/fixtures/poly.rb
|
|
262
|
-
- test/fixtures/readonly_when_archived.rb
|
|
263
|
-
- test/polymorphic_test.rb
|
|
264
|
-
- test/readonly_when_archived_test.rb
|
|
265
|
-
- test/relations_test.rb
|
|
266
|
-
- test/responds_test.rb
|
|
267
|
-
- test/schema.rb
|
|
268
|
-
- test/scope_test.rb
|
|
269
|
-
- test/test_helper.rb
|
|
270
|
-
- test/through_association_test.rb
|
|
271
|
-
- test/transaction_test.rb
|
|
239
|
+
test_files: []
|
data/gemfiles/rails_5.2.gemfile
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# necessary for ApplicationRecord
|
|
2
|
-
if defined?(ApplicationRecord)
|
|
3
|
-
class CallbackArchival5 < ApplicationRecord
|
|
4
|
-
|
|
5
|
-
acts_as_archival
|
|
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
|