effective_trash 0.4.0 → 0.4.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 +1 -2
- data/lib/effective_trash/set_current_user.rb +6 -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: a74c78184cb3ec900ce2336bd3cc00b2f4db31df0743aae8f0c0e81345cc262e
|
4
|
+
data.tar.gz: 1e79f5bfacebcda566c36b5f11ce271be53e5f975294fb49babd82e349c98f0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85d54f6faddf75ef480bd44c6a81c12013aca4ca3f63c81a64f228be7cda2cf8720a6743d2871c0f7d191c70431837ebe07086e3aff5fb0c56f70459219b365b
|
7
|
+
data.tar.gz: 3bc56877b4ec4abd95d7958aa945375c64ff16463b244514c0fef3dd9c2c2210e46a67c14e2a25921c1ad8871e278972fdfac1e8d87fd9aa0aedfa1966f55ccd
|
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
|
-
|
@@ -6,10 +6,14 @@ module EffectiveTrash
|
|
6
6
|
# before_action :set_effective_trash_current_user
|
7
7
|
|
8
8
|
def set_effective_trash_current_user
|
9
|
-
|
9
|
+
begin
|
10
|
+
EffectiveTrash.current_user = current_user
|
11
|
+
yield
|
12
|
+
ensure
|
13
|
+
EffectiveTrash.current_user = nil
|
14
|
+
end
|
10
15
|
end
|
11
16
|
|
12
17
|
end
|
13
18
|
end
|
14
19
|
end
|
15
|
-
|