active_archive 6.0.2 → 6.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/.irbrc +4 -4
- data/lib/active_archive/base.rb +9 -1
- data/lib/active_archive/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b0d3ea33d32ded132a228cf3018e0b5c74632b689e3e7fed86e081477afe94
|
4
|
+
data.tar.gz: cb8aef68f95708b7373183c8b5341a66acde24febe7937b3610cee75b78add30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9f94202412a5238a235fd352fc1026497a9640a04526cae288824075ab3cc09d403f5340bacf6d07ecf4a776b6adefca2ec6c4d9509137f6a5df0eb36ff0616
|
7
|
+
data.tar.gz: 79a6a028e97c2678428ee25de35952327bdf18b921a0390a6677e4fc4c4e476654b901ad0a24f8de9a3adee551c5242f61d87a0e6d76a8b6e5dc30ae9bc3bbe4
|
data/.irbrc
CHANGED
@@ -5,8 +5,8 @@ begin
|
|
5
5
|
require 'awesome_print'
|
6
6
|
|
7
7
|
AwesomePrint.irb!
|
8
|
-
rescue LoadError =>
|
9
|
-
warn "Couldn't load awesome_print: #{
|
8
|
+
rescue LoadError => e
|
9
|
+
warn "Couldn't load awesome_print: #{e}"
|
10
10
|
end
|
11
11
|
|
12
12
|
# IRB
|
@@ -25,8 +25,8 @@ railsrc_path = File.expand_path('.irbrc_rails')
|
|
25
25
|
if (ENV['RAILS_ENV'] || defined?(Rails)) && File.exist?(railsrc_path)
|
26
26
|
begin
|
27
27
|
load railsrc_path
|
28
|
-
rescue Exception =>
|
29
|
-
warn "Could not load: #{railsrc_path} because of #{
|
28
|
+
rescue Exception => e
|
29
|
+
warn "Could not load: #{railsrc_path} because of #{e}"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/lib/active_archive/base.rb
CHANGED
@@ -73,12 +73,20 @@ module ActiveArchive
|
|
73
73
|
|
74
74
|
private
|
75
75
|
|
76
|
+
def updatable?
|
77
|
+
respond_to?(:updated_at)
|
78
|
+
end
|
79
|
+
|
76
80
|
def mark_as_archived
|
77
|
-
|
81
|
+
timestamp = Time.now
|
82
|
+
|
83
|
+
self.updated_at = timestamp if updatable?
|
84
|
+
self.archived_at = timestamp
|
78
85
|
save(validate: false)
|
79
86
|
end
|
80
87
|
|
81
88
|
def mark_as_unarchived
|
89
|
+
self.updated_at = Time.now if updatable?
|
82
90
|
self.archived_at = nil
|
83
91
|
save(validate: false)
|
84
92
|
end
|
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: 6.0
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
- !ruby/object:Gem::Version
|
204
204
|
version: '0'
|
205
205
|
requirements: []
|
206
|
-
rubygems_version: 3.0.
|
206
|
+
rubygems_version: 3.0.3
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
209
|
summary: Gem for soft-deleting ActiveRecord objects.
|