Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to ignore impersonated user ? #706

Open
leoplct opened this issue Apr 24, 2024 · 0 comments
Open

How to ignore impersonated user ? #706

leoplct opened this issue Apr 24, 2024 · 0 comments

Comments

@leoplct
Copy link

leoplct commented Apr 24, 2024

I want to exclude the impersonated user from tracking audits.
I know that I can use this, but it's worsened performance due to JOIN.

class CustomModel < ActiveRecord::Base
  audited unless: Proc.new { |m| m.profile.user.admin? }
end

I'd rather prefer to set it in the initializer. Would be possible?

config/initializers/audited.rb

Audited.max_audits = 1000
Audited.current_user_method = :true_user
@leoplct leoplct changed the title How to ignore by User model? How to ignore impersonated user ? Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant