mongoid-audit 0.1.5 → 0.1.6
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.
- 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
|