You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From having a brief glance at the code, it seems like the gem doesn't analyze calls to #find and #find_by_<attribute>, but I might have missed something.
It would be really valuable to check, whether all those calls have an appropriate DB index on the corresponding column.
The text was updated successfully, but these errors were encountered:
Yes, I guess you would need to parse the whole source code for that. Before you start implementing that yourself, it might be worth to investigate, whether this would be easier to implement as an additional cop for Rubocop. Rubocop already parses everything, but I don't know, whether it is able to then compare the currently parsed file against the indexes from the schema.rb.
Not related to the topic, but since we are talking about AST here. It would be nice to have it as a part of DatabaseConsistency because we would finally be able to write autocorrections for checkers that requires model code changes.
Also, some cool GitHub Action would be possible that can point you to the line where you missed validation.
From having a brief glance at the code, it seems like the gem doesn't analyze calls to
#find
and#find_by_<attribute>
, but I might have missed something.It would be really valuable to check, whether all those calls have an appropriate DB index on the corresponding column.
The text was updated successfully, but these errors were encountered: