paranoia 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/README.md +4 -0
- data/lib/paranoia.rb +2 -2
- data/lib/paranoia/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cebeb3a3793e609311d39a7ade99dfa04defb9b
|
4
|
+
data.tar.gz: 43772ac7c1bbcfd9435170ecb14540bafdb80bcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fe0ec6389b02424eb3128f5e4add46d86a15792737fa55ff3c9e11600c982356fa6393c55968792dabcb0271043a47a8c2949454fb9358607dc5f484b308fd4
|
7
|
+
data.tar.gz: 8770f65052476d8fa080a93af63655d13c872e1c2ec34ae89c157fe1d38e463dc398c921dd911c6a7c763ac766af4e435c5a474e33542326f702f9393555c693
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -158,6 +158,8 @@ If you want to restore a record:
|
|
158
158
|
|
159
159
|
``` ruby
|
160
160
|
Client.restore(id)
|
161
|
+
# or
|
162
|
+
client.restore
|
161
163
|
```
|
162
164
|
|
163
165
|
If you want to restore a whole bunch of records:
|
@@ -170,6 +172,8 @@ If you want to restore a record and their dependently destroyed associated recor
|
|
170
172
|
|
171
173
|
``` ruby
|
172
174
|
Client.restore(id, :recursive => true)
|
175
|
+
# or
|
176
|
+
client.restore(:recursive => true)
|
173
177
|
```
|
174
178
|
|
175
179
|
If you want callbacks to trigger before a restore:
|
data/lib/paranoia.rb
CHANGED
@@ -29,7 +29,7 @@ module Paranoia
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def only_deleted
|
32
|
-
with_deleted.where.not(
|
32
|
+
with_deleted.where.not(paranoia_column => paranoia_sentinel_value)
|
33
33
|
end
|
34
34
|
alias :deleted :only_deleted
|
35
35
|
|
@@ -199,7 +199,7 @@ class ActiveRecord::Base
|
|
199
199
|
self.paranoia_column = (options[:column] || :deleted_at).to_s
|
200
200
|
self.paranoia_sentinel_value = options.fetch(:sentinel_value) { Paranoia.default_sentinel_value }
|
201
201
|
def self.paranoia_scope
|
202
|
-
where(
|
202
|
+
where(paranoia_column => paranoia_sentinel_value)
|
203
203
|
end
|
204
204
|
default_scope { paranoia_scope }
|
205
205
|
|
data/lib/paranoia/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paranoia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radarlistener@gmail.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|