Browse Source

audit tweaks

pull/1/head
Nicolae Claudius 11 years ago
parent
commit
f547f215db
  1. 6
      app/controllers/application_controller.rb
  2. 6
      app/models/user.rb

6
app/controllers/application_controller.rb

@ -65,7 +65,11 @@ class ApplicationController < ActionController::Base
end end
def user_for_paper_trail def user_for_paper_trail
current_user.to_paper_trail rescue 'Public' if user_signed_in?
current_user.to_paper_trail
else
"Public ip:#{client_remote_ip}"
end
end end
end end

6
app/models/user.rb

@ -2,9 +2,11 @@ class User < ActiveRecord::Base
include SentientModel include SentientModel
model_stamper model_stamper
stampable stampable
has_paper_trail ignore: [ :sign_in_count, has_paper_trail ignore: [
:updated_at, :sign_in_count,
:last_sign_in_at, :current_sign_in_at, :last_sign_in_at, :current_sign_in_at,
:last_sign_in_ip, :current_sign_in_ip ] :last_sign_in_ip, :current_sign_in_ip
]
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :timeoutable and :omniauthable # :token_authenticatable, :encryptable, :timeoutable and :omniauthable

Loading…
Cancel
Save