active_archive 6.0.2 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b227c206994dbd0870daa51ea5560753a60743ace96526f595f52571dc9efb19
4
- data.tar.gz: 42344b758b06621d8ec5f1a0e9dd5265d136ccf650984e7a10cb358a8d8736b6
3
+ metadata.gz: 66b0d3ea33d32ded132a228cf3018e0b5c74632b689e3e7fed86e081477afe94
4
+ data.tar.gz: cb8aef68f95708b7373183c8b5341a66acde24febe7937b3610cee75b78add30
5
5
  SHA512:
6
- metadata.gz: 2d594cb5dcf53dea45edd01ec8a1ae9fd2658d17770857e96366a88a851a5ec66ebf7a33a147e4569975aefec4af452b27c5c12bccd94ae6e4763b6c2340d5b2
7
- data.tar.gz: b895f13b73c1b931b2399640b2e07c72ef239cdb5d2ecbe299429576d298fda8829c539c765c2aa28217a63da1ce926e883d07ac7923a05b473adcce5f3549dc
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 => err
9
- warn "Couldn't load awesome_print: #{err}"
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 => err
29
- warn "Could not load: #{railsrc_path} because of #{err}"
28
+ rescue Exception => e
29
+ warn "Could not load: #{railsrc_path} because of #{e}"
30
30
  end
31
31
  end
32
32
 
@@ -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
- self.archived_at = Time.now
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveArchive
4
- VERSION ||= '6.0.2'
4
+ VERSION ||= '6.1.0'
5
5
  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.2
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-01-10 00:00:00.000000000 Z
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.2
206
+ rubygems_version: 3.0.3
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: Gem for soft-deleting ActiveRecord objects.