Skip to content

Commit

Permalink
Only check for indexes on models with tables
Browse files Browse the repository at this point in the history
Update the `LolDba::IndexFinding.model_classes` method to return only classes that have a table in the database.
  • Loading branch information
fightingtheboss committed Mar 7, 2024
1 parent 58e51ae commit 0abb2db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lol_dba/index_finding/index_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0abb2db

Please sign in to comment.