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

SQL callsite detection doesn't work for views/controllers in gems #79

Open
fintanf opened this issue Sep 10, 2014 · 0 comments
Open

SQL callsite detection doesn't work for views/controllers in gems #79

fintanf opened this issue Sep 10, 2014 · 0 comments

Comments

@fintanf
Copy link

fintanf commented Sep 10, 2014

The callsite code in AppNotifications looks for the first line matching Rails.root in the caller array. This works great for all application-local code and templates, but when the AR query originates in a gem it's entirely passed over and you end up with #{Rails.root}/bin/rails as the callsite. Right now I'm seeing this behaviour when working on a spree app, but I assume there are other gems out there providing AR-interacting views and controllers that would also have a problem with this.

There may not be a perfect regexp(s) that can deal with this, but allowing a custom set of regexps or a block that is used for the select on the caller array is desirable. This would at least allow some customisation for these use cases.

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