Class: DatabaseConsistency::Checkers::MissingIndexFindByChecker
- Inherits:
-
ColumnChecker
- Object
- BaseChecker
- ColumnChecker
- DatabaseConsistency::Checkers::MissingIndexFindByChecker
- Defined in:
- lib/database_consistency/checkers/column_checkers/missing_index_find_by_checker.rb
Overview
This class checks for columns used in find_by queries that are missing a database index. It uses the Prism parser (Ruby stdlib since 3.3) to traverse the AST of all project source files (found by iterating loaded constants and excluding gem paths) and detect calls such as find_by_<column>, find_by(column: …) and find_by(“column” => …). The checker is automatically skipped on Ruby versions where Prism is not available.
Defined Under Namespace
Classes: FindByCollector
Constant Summary collapse
- Report =
ReportBuilder.define( DatabaseConsistency::Report, :source_location, :total_findings_count )
Instance Attribute Summary
Attributes inherited from ColumnChecker
Method Summary
Methods inherited from ColumnChecker
#column_or_attribute_name, #initialize, processor, #table_or_model_name
Methods inherited from BaseChecker
checker_name, enabled?, #enabled?, inherited, #report, #report_if_enabled?
Constructor Details
This class inherits a constructor from DatabaseConsistency::Checkers::ColumnChecker