triggerable 0.1.6 → 0.1.7
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 -1
- data/lib/triggerable/actions.rb +13 -3
- data/lib/triggerable/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: 01cc155d845bc2afb7c7eb308113e74819a00d4f
|
4
|
+
data.tar.gz: 81074d512740a11417bc35480d4ffc1e3192dfef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01af1a6893ed82e2878e57ab66578c6b05f5dae25eb822faf06ba66faf5071af0329b0ab266a306b0ef2b2a4b39b7b0e75d0b40f7f8651009ae4de3efffe70ee
|
7
|
+
data.tar.gz: e0d69053d213d38377dcaa496ded6d51cbc630933f2e623ba79a0d53b384037dc1db94a94b3c657d1d9566f4682b1d2b4ac7bf3dab085c5746d5fa4ac3978b00
|
data/README.md
CHANGED
data/lib/triggerable/actions.rb
CHANGED
@@ -22,9 +22,19 @@ module Triggerable
|
|
22
22
|
def run_for! object, trigger_name
|
23
23
|
proc = @block
|
24
24
|
object.instance_eval do
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
change_whodunnit = trigger_name.present? && defined?(PaperTrail)
|
26
|
+
old_whodunnit = nil
|
27
|
+
|
28
|
+
if change_whodunnit
|
29
|
+
old_whodunnit = PaperTrail.whodunnit
|
30
|
+
PaperTrail.whodunnit = trigger_name
|
31
|
+
end
|
32
|
+
|
33
|
+
begin
|
34
|
+
instance_exec(&proc)
|
35
|
+
ensure
|
36
|
+
PaperTrail.whodunnit = old_whodunnit if change_whodunnit
|
37
|
+
end
|
28
38
|
end
|
29
39
|
end
|
30
40
|
end
|
data/lib/triggerable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triggerable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11
|
11
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|