destroyed_at 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: 9bc7d600d04c50b142c9c5191f0c10fc6da97818
4
- data.tar.gz: 3013c9ef4cd5f8e2702a9c2299c34277bfddad9c
3
+ metadata.gz: 28d8c5c555222b4e7e45c3a782e60b7026970c37
4
+ data.tar.gz: 7f343f2ec3da1c7baec08b06c2433a29a2ab0fc5
5
5
  SHA512:
6
- metadata.gz: 7344d639a761abc3ba0765fc53e7ffafd94eac0b155879b0e99fc6f937e35f445945667842aff8ebd3f5e71a9c5b933e479ca1059eb24d78851805c26e803265
7
- data.tar.gz: 0717292ca7a7b3075d4fb00c49a226a50f91ba337dcdd19866e638604eca59297c3a16110204900e5b9e3d30db9bc4ca04d7eeda21192523b24d879f851771ed
6
+ metadata.gz: 068490e630e8dd369dc013ffa5e5ac9a44cae31bbd88d4e080b1621154dd85da503783d3bf1fd9bb082dbcff97d1079d98561a6b27760ff2782681fbee7bd22f
7
+ data.tar.gz: 9f4f2b3dccba9fa4046039e055ed1726d159dea30f4781aac80ab29e1fceea3570e631a74867e94afbd8808da4767a3eeda772c11041aa4dc01a2c8895b2facc
data/lib/destroyed_at.rb CHANGED
@@ -24,7 +24,7 @@ module DestroyedAt
24
24
  state = nil
25
25
  run_callbacks(:restore) do
26
26
  self.destroyed_at = nil
27
- if state = self.save(callbacks: false)
27
+ if state = self.save(callbacks: false, validate: false)
28
28
  @destroyed = false
29
29
  _restore_associations
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module DestroyedAt
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -124,4 +124,10 @@ describe 'Destroying AR models' do
124
124
  user.restore
125
125
  user.before_save_count.must_equal nil
126
126
  end
127
+
128
+ it 'skips validations on restore' do
129
+ user = User.create(nil_attribute: '123')
130
+ user.destroy
131
+ user.restore.must_equal true
132
+ end
127
133
  end
data/test/test_helper.rb CHANGED
@@ -44,7 +44,7 @@ class User < ActiveRecord::Base
44
44
  has_many :cars, :through => :fleets, :dependent => :destroy
45
45
  before_save :increment_counter
46
46
 
47
- attr_accessor :before_save_count
47
+ attr_accessor :before_save_count, :nil_attribute
48
48
 
49
49
  private
50
50
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: destroyed_at
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Dupuis Jr.