active_archive 4.0.5 → 4.0.6
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/.rubocop.yml +15 -13
- data/active_archive.gemspec +2 -1
- data/lib/active_archive/base.rb +4 -4
- data/lib/active_archive/version.rb +1 -1
- data/lib/active_archive.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92c1e713b49eefb44aeb6add213b87c81de0225d
|
4
|
+
data.tar.gz: 6c5106eff7503054c0793240d47a184c0463a713
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0369966d50e4af17708b1756466a6dce60afa64f061eeab2d56798b83679a8dc1be9764e7b18a171dd6a3511b60c919112f2ccdface89c4f04707478a30e0b88'
|
7
|
+
data.tar.gz: 69e4a6ccf751be3252291e924780d076f185cfafd4d542fc4c14e19d092b73821b5842843c6610a719ac75148f23e4325088f687f1605c47da62f23395efb75e
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,25 @@
|
|
1
1
|
AllCops:
|
2
2
|
DisplayCopNames: true
|
3
3
|
DisplayStyleGuide: true
|
4
|
-
TargetRubyVersion: 2.
|
4
|
+
TargetRubyVersion: 2.4
|
5
5
|
Exclude:
|
6
6
|
- 'spec/**/**/*'
|
7
|
+
Layout/ClosingParenthesisIndentation:
|
8
|
+
Enabled: false
|
9
|
+
Layout/EmptyLinesAroundBlockBody:
|
10
|
+
Enabled: false
|
11
|
+
Layout/EmptyLinesAroundClassBody:
|
12
|
+
Enabled: false
|
13
|
+
Layout/EmptyLinesAroundModuleBody:
|
14
|
+
Enabled: false
|
15
|
+
Layout/FirstParameterIndentation:
|
16
|
+
Enabled: false
|
17
|
+
Layout/MultilineMethodCallIndentation:
|
18
|
+
EnforcedStyle: aligned
|
7
19
|
LineLength:
|
8
20
|
Max: 100
|
21
|
+
Lint/ScriptPermission:
|
22
|
+
Enabled: false
|
9
23
|
Metrics/ClassLength:
|
10
24
|
Enabled: false
|
11
25
|
Metrics/ModuleLength:
|
@@ -14,24 +28,12 @@ Style/Alias:
|
|
14
28
|
EnforcedStyle: prefer_alias_method
|
15
29
|
Style/BracesAroundHashParameters:
|
16
30
|
Enabled: false
|
17
|
-
Style/ClosingParenthesisIndentation:
|
18
|
-
Enabled: false
|
19
31
|
Style/Documentation:
|
20
32
|
Enabled: false
|
21
|
-
Style/EmptyLinesAroundBlockBody:
|
22
|
-
Enabled: false
|
23
|
-
Style/EmptyLinesAroundClassBody:
|
24
|
-
Enabled: false
|
25
|
-
Style/EmptyLinesAroundModuleBody:
|
26
|
-
Enabled: false
|
27
33
|
Style/HashSyntax:
|
28
34
|
Enabled: false
|
29
|
-
Style/FirstParameterIndentation:
|
30
|
-
Enabled: false
|
31
35
|
Style/FrozenStringLiteralComment:
|
32
36
|
Enabled: false
|
33
|
-
Style/MultilineMethodCallIndentation:
|
34
|
-
EnforcedStyle: aligned
|
35
37
|
Style/NumericLiterals:
|
36
38
|
Enabled: false
|
37
39
|
Style/RescueModifier:
|
data/active_archive.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'active_archive/version'
|
@@ -16,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
16
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
18
|
spec.bindir = 'exe'
|
18
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
-
spec.require_paths = [
|
20
|
+
spec.require_paths = %w[lib]
|
20
21
|
|
21
22
|
spec.add_runtime_dependency 'rails'
|
22
23
|
spec.add_runtime_dependency 'dry-configurable'
|
data/lib/active_archive/base.rb
CHANGED
@@ -137,7 +137,7 @@ module ActiveArchive
|
|
137
137
|
|
138
138
|
def unarchive_destroyed_dependent_records(force = nil)
|
139
139
|
self.class.reflections
|
140
|
-
.select { |_, ref|
|
140
|
+
.select { |_, ref| ref.options[:dependent].to_s == 'destroy' && ref.klass.archivable? }
|
141
141
|
.each do |name, ref|
|
142
142
|
dependent_records_for_unarchival(name, ref).each { |rec| rec.try(:unarchive, force) }
|
143
143
|
reload
|
@@ -169,15 +169,15 @@ module ActiveArchive
|
|
169
169
|
end
|
170
170
|
|
171
171
|
def should_force_destroy?(force)
|
172
|
-
force.is_a?(Hash) ? force[:force] : (
|
172
|
+
force.is_a?(Hash) ? force[:force] : (force == :force)
|
173
173
|
end
|
174
174
|
|
175
175
|
def should_ignore_validations?(force)
|
176
|
-
force.is_a?(Hash) && (
|
176
|
+
force.is_a?(Hash) && (force[:validate] == false)
|
177
177
|
end
|
178
178
|
|
179
179
|
def should_unarchive_parent_first?(order)
|
180
|
-
order.is_a?(Hash) && (
|
180
|
+
order.is_a?(Hash) && (order[:reverse] == true)
|
181
181
|
end
|
182
182
|
|
183
183
|
end
|
data/lib/active_archive.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: '0'
|
233
233
|
requirements: []
|
234
234
|
rubyforge_project:
|
235
|
-
rubygems_version: 2.6.
|
235
|
+
rubygems_version: 2.6.12
|
236
236
|
signing_key:
|
237
237
|
specification_version: 4
|
238
238
|
summary: Gem for soft-deleting ActiveRecord objects.
|