soft_deletion 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soft_deletion (0.5.3)
4
+ soft_deletion (0.5.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -20,7 +20,7 @@ module SoftDeletion
20
20
 
21
21
  def soft_undelete!(limit)
22
22
  klass.with_deleted do
23
- dependencies.reject { |m| m.deleted_at < limit }.each(&:soft_undelete!)
23
+ dependencies.reject { |m| m.deleted_at.to_i < limit.to_i }.each(&:soft_undelete!)
24
24
  end
25
25
  end
26
26
 
@@ -1,3 +1,3 @@
1
1
  module SoftDeletion
2
- VERSION = '0.5.3'
2
+ VERSION = '0.5.4'
3
3
  end
@@ -310,6 +310,13 @@ describe SoftDeletion do
310
310
  @forum.should_not be_deleted
311
311
  end
312
312
 
313
+ it "does not fail if dependent associations are not deleted" do
314
+ @forum.soft_undelete!
315
+ undelete!
316
+ @forum.reload
317
+ @forum.should_not be_deleted
318
+ end
319
+
313
320
  it "does not restore far previous deletions" do
314
321
  @forum.update_attributes(:deleted_at => 1.year.ago)
315
322
  undelete!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soft_deletion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -54,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
54
  version: '0'
55
55
  segments:
56
56
  - 0
57
- hash: -4553926914624727547
57
+ hash: -840754898484082462
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  none: false
60
60
  requirements:
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  version: '0'
64
64
  segments:
65
65
  - 0
66
- hash: -4553926914624727547
66
+ hash: -840754898484082462
67
67
  requirements: []
68
68
  rubyforge_project:
69
69
  rubygems_version: 1.8.25