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

Audits with line of code location #691

Open
ali-ehmed opened this issue Jan 2, 2024 · 1 comment
Open

Audits with line of code location #691

ali-ehmed opened this issue Jan 2, 2024 · 1 comment

Comments

@ali-ehmed
Copy link

ali-ehmed commented Jan 2, 2024

We recently have been checking the audits table to find out a cause of an unexpected update operation. We weren't expecting one of the attribute of a model to get updated and eventually sending out emails, but we came to know that there's was a separate entry of that update action in the table and since our code base is very big, it was hard to debug the location of that update operation. This scenario made me wondered if there could be a way to also store a class name and line of code as well so that it becomes easier to debug sometimes why/where operations are performed by checking out the logic.

So a new column action_location or something that will store a file name with a line of code e.g app/services/update_user.rb#L56.

I'm not really sure how useful it would be to add this support in the audited engine but I'd love to know more thoughts on this from others.

@ali-ehmed ali-ehmed changed the title Audited records with line of code location Audits with line of code location Jan 3, 2024
@danielmorrison
Copy link
Member

Based on how Audited hooks into Rails, I'm not sure how easy it would be to accomplish what you want. Open to PRs though.

Alternately, you could make liberal use of comments to leave yourself breadcrumbs.

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

2 participants