paranoia 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -2
- data/lib/paranoia.rb +2 -2
- data/lib/paranoia/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07438f51e6a97736c8bbb1778bbb7b9cbe5c623c
|
4
|
+
data.tar.gz: 4456e34fe1c2988dfe9cb1014ca8002e288ec45c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d13573dc45ac55f6aaf478b20a3e74e2d209d37f6c17e826f293aec36ffc568b7952078eb42f9d63753ef42162993b127d11773e2a7afb9fe3558955faf15d1
|
7
|
+
data.tar.gz: 5b84920192ef0cd5e13acf1cc433753b3f6f1cc69ce6afa7369404e6ac2bd7394b96b33b22415d5e2de41928c5b0582f9498cbb592d1eb291a651ac6f0e6bb97
|
data/README.md
CHANGED
@@ -6,10 +6,24 @@ You would use either plugin / gem if you wished that when you called `destroy` o
|
|
6
6
|
|
7
7
|
## Installation & Usage
|
8
8
|
|
9
|
-
|
9
|
+
For Rails 3, please use version 1 of Paranoia:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'paranoia'
|
12
|
+
gem 'paranoia', '~> 1.0'
|
13
|
+
```
|
14
|
+
|
15
|
+
For Rails 4, please use version 2 of Paranoia:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem 'paranoia', '~> 2.0'
|
19
|
+
```
|
20
|
+
|
21
|
+
Of course you can install this from GitHub as well:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
gem 'paranoia', :github => 'radar/paranoia', :branch => 'master'
|
25
|
+
# or
|
26
|
+
gem 'paranoia', :github => 'radar/paranoia', :branch => 'rails-4'
|
13
27
|
```
|
14
28
|
|
15
29
|
Then run:
|
data/lib/paranoia.rb
CHANGED
@@ -7,11 +7,11 @@ module Paranoia
|
|
7
7
|
def paranoid? ; true ; end
|
8
8
|
|
9
9
|
def only_deleted
|
10
|
-
|
10
|
+
scoped.tap { |x| x.default_scoped = false }.where("#{self.table_name}.deleted_at is not null")
|
11
11
|
end
|
12
12
|
|
13
13
|
def with_deleted
|
14
|
-
|
14
|
+
scoped.tap { |x| x.default_scoped = false }
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
data/lib/paranoia/version.rb
CHANGED