soft_deletion 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soft_deletion (0.5.4)
4
+ soft_deletion (0.5.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,7 +12,7 @@ module SoftDeletion
12
12
  when :nullify
13
13
  nullify_dependencies
14
14
  when :delete_all
15
- dependency.update_all(:deleted_at => Time.now)
15
+ dependency.update_all(record.class.mark_as_soft_deleted_sql)
16
16
  else
17
17
  dependencies.each(&:soft_delete!)
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module SoftDeletion
2
- VERSION = '0.5.4'
2
+ VERSION = '0.5.5'
3
3
  end
@@ -311,7 +311,7 @@ describe SoftDeletion do
311
311
  end
312
312
 
313
313
  it "does not fail if dependent associations are not deleted" do
314
- @forum.soft_undelete!
314
+ @forum.reload.soft_undelete!
315
315
  undelete!
316
316
  @forum.reload
317
317
  @forum.should_not be_deleted
@@ -346,6 +346,14 @@ describe SoftDeletion do
346
346
  forum.should_not be_deleted # just did an update_all
347
347
  Forum.find(forum.id).should be_deleted
348
348
  end
349
+
350
+ it "custom sql to delete all" do
351
+ category = DDACategory.create!
352
+ forum = category.forums.create!
353
+ DDACategory.should_receive(:mark_as_soft_deleted_sql).and_return "fooo"
354
+ category.forums.should_receive(:update_all).with("fooo")
355
+ category.soft_delete!
356
+ end
349
357
  end
350
358
 
351
359
  context "a soft-deleted has-many category that defaults dependent forum references on delete" do
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.4
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-07 00:00:00.000000000 Z
12
+ date: 2013-11-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: michael@grosser.it
@@ -54,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
54
  version: '0'
55
55
  segments:
56
56
  - 0
57
- hash: -840754898484082462
57
+ hash: 4555391312656709535
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  none: false
60
60
  requirements:
@@ -63,10 +63,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  version: '0'
64
64
  segments:
65
65
  - 0
66
- hash: -840754898484082462
66
+ hash: 4555391312656709535
67
67
  requirements: []
68
68
  rubyforge_project:
69
- rubygems_version: 1.8.25
69
+ rubygems_version: 1.8.23
70
70
  signing_key:
71
71
  specification_version: 3
72
72
  summary: Explicit soft deletion for ActiveRecord via deleted_at and default scope.