mongoid-audit 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongoid-audit/sweeper.rb +5 -3
- data/lib/mongoid-audit/version.rb +1 -1
- metadata +1 -1
@@ -26,11 +26,13 @@ module Mongoid::Audit
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def before_create(track)
|
29
|
-
track.modifier =
|
29
|
+
track.modifier = audit_current_user if track.modifier.nil?
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
33
|
-
if controller.
|
32
|
+
def audit_current_user
|
33
|
+
if controller.nil?
|
34
|
+
nil
|
35
|
+
elsif controller.respond_to?(Mongoid::Audit.current_user_method, true)
|
34
36
|
controller.send Mongoid::Audit.current_user_method
|
35
37
|
else
|
36
38
|
nil
|