Created
November 25, 2014 13:53
-
-
Save magicmarkker/d0ac2bd6a3d9d435af05 to your computer and use it in GitHub Desktop.
audit.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Auditable | |
extend ActiveSupport::Concern | |
# @TODO: Figure out a way around this? | |
# This causes the session to not exist in rspec | |
included do | |
if Rails.env != "test" | |
audited except: [:heartbeat, :try], allow_mass_assignment: true | |
end | |
end | |
def after_audit | |
self.client_id = Client.current_id || nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment