Skip to content

Instantly share code, notes, and snippets.

@magicmarkker
Created November 25, 2014 13:53
Show Gist options
  • Save magicmarkker/d0ac2bd6a3d9d435af05 to your computer and use it in GitHub Desktop.
Save magicmarkker/d0ac2bd6a3d9d435af05 to your computer and use it in GitHub Desktop.
audit.rb
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