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.
@@ -26,11 +26,13 @@ module Mongoid::Audit
26
26
  end
27
27
 
28
28
  def before_create(track)
29
- track.modifier = current_user if track.modifier.nil?
29
+ track.modifier = audit_current_user if track.modifier.nil?
30
30
  end
31
31
 
32
- def current_user
33
- if controller.respond_to?(Mongoid::Audit.current_user_method, true)
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
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Audit
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: