From 0abb2db5672afd9fa7791184c8ba5f4d3f03d195 Mon Sep 17 00:00:00 2001 From: Mina Mikhail Date: Thu, 7 Mar 2024 13:40:40 -0500 Subject: [PATCH] Only check for indexes on models with tables Update the `LolDba::IndexFinding.model_classes` method to return only classes that have a table in the database. --- lib/lol_dba/index_finding/index_finder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lol_dba/index_finding/index_finder.rb b/lib/lol_dba/index_finding/index_finder.rb index a9c9f78..cc1a9e3 100644 --- a/lib/lol_dba/index_finding/index_finder.rb +++ b/lib/lol_dba/index_finding/index_finder.rb @@ -68,7 +68,7 @@ def self.primary_key(table_name) def self.model_classes ActiveRecord::Base.descendants.select do |obj| - Class == obj.class && session_store?(obj) + Class == obj.class && session_store?(obj) && obj.table_exists? end end