effective_trash 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/effective_trash/set_current_user.rb +7 -2
- data/lib/effective_trash/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e396467b51605c57556e6709d570c9b842a854e70d4b2a438095ae27c6588ce4
|
4
|
+
data.tar.gz: 4564fe2452cb161287809d21da658a66014aa155e0af8a99f069019edf6e8c70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a96ee36e53a801f9c126e61f63bac62ee9d063017aa870892f56257d80ceb3e4a5ab929694a82a9be86c6f05b09143e7bf0358444062dcb80350d62946bd385
|
7
|
+
data.tar.gz: a2f6b828a1c74e64eb2e361fdf33f19a5492c925295f459a21f7c72be839352a379b36291fdf17b7a6ef9516a13e63b96ba29c1678838046bf824d81ac71778c
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ and to your contoller:
|
|
46
46
|
|
47
47
|
```ruby
|
48
48
|
class ApplicationController < ActionController::Base
|
49
|
-
|
49
|
+
around_action :set_effective_trash_current_user
|
50
50
|
end
|
51
51
|
```
|
52
52
|
|
@@ -114,4 +114,3 @@ MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
|
|
114
114
|
4. Push to the branch (`git push origin my-new-feature`)
|
115
115
|
5. Bonus points for test coverage
|
116
116
|
6. Create new Pull Request
|
117
|
-
|
@@ -3,13 +3,18 @@ module EffectiveTrash
|
|
3
3
|
module ActionController
|
4
4
|
|
5
5
|
# Add me to your ApplicationController
|
6
|
-
#
|
6
|
+
# around_action :set_effective_trash_current_user
|
7
7
|
|
8
8
|
def set_effective_trash_current_user
|
9
9
|
EffectiveTrash.current_user = current_user
|
10
|
+
|
11
|
+
if block_given?
|
12
|
+
retval = yield
|
13
|
+
EffectiveTrash.current_user = nil
|
14
|
+
retval
|
15
|
+
end
|
10
16
|
end
|
11
17
|
|
12
18
|
end
|
13
19
|
end
|
14
20
|
end
|
15
|
-
|