guard_against_physical_delete 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/master_and_pr.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/gemfiles/Gemfile_rails_5.0.rb.lock +2 -2
- data/gemfiles/Gemfile_rails_5.1.rb.lock +2 -2
- data/gemfiles/Gemfile_rails_5.2.rb.lock +2 -2
- data/gemfiles/Gemfile_rails_6.0.rb.lock +2 -2
- data/gemfiles/Gemfile_rails_6.1.rb +5 -0
- data/gemfiles/Gemfile_rails_6.1.rb.lock +74 -0
- data/guard_against_physical_delete.gemspec +1 -1
- data/lib/guard_against_physical_delete/support_counter_cache/associations/builder/belongs_to.rb +2 -2
- data/lib/guard_against_physical_delete/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf3003e9c60b6e19e0f13de9cfca5c1ccf85f8a5c33cbfb327bc60ead38c9332
|
4
|
+
data.tar.gz: 89f4cd9c51bb7bff0712215b6a5b503d7148b982694708a7a274423e59134a1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55d3b887dbaf294c6b262620dc24b0d7be5cf147798ad8899137121b6cce1fdb547569acfdd1cec363a3879b3dd5758396533cf8db2bc361fcdabe7492e1b2ae
|
7
|
+
data.tar.gz: b8e1c3941e184465eec596f0da8e8a662135c462bf5e42b66fbb4e5c1d52261407cb71b1433a4cd935efe8cc6ed78db826d23c61137092f2e981d91347246a4e
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,74 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
guard_against_physical_delete (2.1.0)
|
5
|
+
activerecord (>= 5, < 6.2)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (6.1.4.1)
|
11
|
+
activesupport (= 6.1.4.1)
|
12
|
+
activerecord (6.1.4.1)
|
13
|
+
activemodel (= 6.1.4.1)
|
14
|
+
activesupport (= 6.1.4.1)
|
15
|
+
activesupport (6.1.4.1)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
zeitwerk (~> 2.3)
|
21
|
+
concurrent-ruby (1.1.9)
|
22
|
+
countdownlatch (1.0.0)
|
23
|
+
database_cleaner (2.0.1)
|
24
|
+
database_cleaner-active_record (~> 2.0.0)
|
25
|
+
database_cleaner-active_record (2.0.1)
|
26
|
+
activerecord (>= 5.a)
|
27
|
+
database_cleaner-core (~> 2.0.0)
|
28
|
+
database_cleaner-core (2.0.1)
|
29
|
+
diff-lcs (1.4.4)
|
30
|
+
docile (1.4.0)
|
31
|
+
i18n (1.8.11)
|
32
|
+
concurrent-ruby (~> 1.0)
|
33
|
+
minitest (5.14.4)
|
34
|
+
rake (13.0.6)
|
35
|
+
rspec (3.10.0)
|
36
|
+
rspec-core (~> 3.10.0)
|
37
|
+
rspec-expectations (~> 3.10.0)
|
38
|
+
rspec-mocks (~> 3.10.0)
|
39
|
+
rspec-core (3.10.1)
|
40
|
+
rspec-support (~> 3.10.0)
|
41
|
+
rspec-expectations (3.10.1)
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
+
rspec-support (~> 3.10.0)
|
44
|
+
rspec-mocks (3.10.2)
|
45
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
+
rspec-support (~> 3.10.0)
|
47
|
+
rspec-support (3.10.3)
|
48
|
+
simplecov (0.21.2)
|
49
|
+
docile (~> 1.1)
|
50
|
+
simplecov-html (~> 0.11)
|
51
|
+
simplecov_json_formatter (~> 0.1)
|
52
|
+
simplecov-html (0.12.3)
|
53
|
+
simplecov_json_formatter (0.1.3)
|
54
|
+
sqlite3 (1.4.2)
|
55
|
+
tzinfo (2.0.4)
|
56
|
+
concurrent-ruby (~> 1.0)
|
57
|
+
zeitwerk (2.5.1)
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
x86_64-linux
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
activerecord (~> 6.1.0)
|
64
|
+
bundler
|
65
|
+
countdownlatch
|
66
|
+
database_cleaner
|
67
|
+
guard_against_physical_delete!
|
68
|
+
rake (~> 13)
|
69
|
+
rspec (~> 3)
|
70
|
+
simplecov
|
71
|
+
sqlite3 (~> 1.4)
|
72
|
+
|
73
|
+
BUNDLED WITH
|
74
|
+
2.2.29
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata["homepage_uri"] = s.homepage
|
21
21
|
s.metadata["source_code_uri"] = s.homepage
|
22
22
|
|
23
|
-
s.add_runtime_dependency "activerecord", ">= 5", "< 6.
|
23
|
+
s.add_runtime_dependency "activerecord", ">= 5", "< 6.2"
|
24
24
|
s.add_development_dependency "rake", "~> 13"
|
25
25
|
s.add_development_dependency "rspec", "~> 3"
|
26
26
|
s.add_development_dependency "sqlite3", "~> 1.4"
|
data/lib/guard_against_physical_delete/support_counter_cache/associations/builder/belongs_to.rb
CHANGED
@@ -12,12 +12,12 @@ module GuardAgainstPhysicalDelete
|
|
12
12
|
def add_logical_delete_counter_cache_methods(mixin)
|
13
13
|
mixin.class_eval do
|
14
14
|
def adjust_counter_caches_for_logical_deletion(reflection)
|
15
|
-
if attribute_before_last_save(logical_delete_column).nil? &&
|
15
|
+
if attribute_before_last_save(logical_delete_column).nil? && read_attribute(logical_delete_column)
|
16
16
|
reflection.klass.decrement_counter(
|
17
17
|
reflection.counter_cache_column,
|
18
18
|
attribute_before_last_save(reflection.foreign_key)
|
19
19
|
)
|
20
|
-
elsif attribute_before_last_save(logical_delete_column) &&
|
20
|
+
elsif attribute_before_last_save(logical_delete_column) && read_attribute(logical_delete_column).nil?
|
21
21
|
reflection.klass.increment_counter(
|
22
22
|
reflection.counter_cache_column,
|
23
23
|
attribute_before_last_save(reflection.foreign_key)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard_against_physical_delete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MORITA shingo
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '6.
|
22
|
+
version: '6.2'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '6.
|
32
|
+
version: '6.2'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rake
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +150,8 @@ files:
|
|
150
150
|
- gemfiles/Gemfile_rails_5.2.rb.lock
|
151
151
|
- gemfiles/Gemfile_rails_6.0.rb
|
152
152
|
- gemfiles/Gemfile_rails_6.0.rb.lock
|
153
|
+
- gemfiles/Gemfile_rails_6.1.rb
|
154
|
+
- gemfiles/Gemfile_rails_6.1.rb.lock
|
153
155
|
- guard_against_physical_delete.gemspec
|
154
156
|
- lib/guard_against_physical_delete.rb
|
155
157
|
- lib/guard_against_physical_delete/base.rb
|
@@ -179,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
181
|
- !ruby/object:Gem::Version
|
180
182
|
version: '0'
|
181
183
|
requirements: []
|
182
|
-
rubygems_version: 3.
|
184
|
+
rubygems_version: 3.3.7
|
183
185
|
signing_key:
|
184
186
|
specification_version: 4
|
185
187
|
summary: A monkey patch for ActiveRecord to prevent physical deletion.
|