sequel-paranoid 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sequel/plugins/paranoid.rb +3 -0
  2. metadata +2 -2
@@ -41,6 +41,9 @@ module Sequel::Plugins
41
41
  end
42
42
  end
43
43
 
44
+ define_method("recover") do
45
+ self.class.unfiltered.where(:id => self.id).update(:deleted_at => nil)
46
+ end
44
47
 
45
48
  #
46
49
  # Inject the default scope that filters deleted entries.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-paranoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -50,7 +50,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
50
  version: '0'
51
51
  segments:
52
52
  - 0
53
- hash: 3660781128148827115
53
+ hash: 725648105282744051
54
54
  required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  none: false
56
56
  requirements: