lib/spoom/deadcode/plugins/rails.rb in spoom-1.3.2 vs lib/spoom/deadcode/plugins/rails.rb in spoom-1.3.3

- old
+ new

@@ -7,24 +7,24 @@ class Rails < Base extend T::Sig ignore_constants_named("APP_PATH", "ENGINE_PATH", "ENGINE_ROOT") - sig { override.params(indexer: Indexer, definition: Definition).void } - def on_define_class(indexer, definition) - definition.ignored! if file_is_helper?(indexer) + sig { override.params(definition: Model::Class).void } + def on_define_class(definition) + @index.ignore(definition) if file_is_helper?(definition) end - sig { override.params(indexer: Indexer, definition: Definition).void } - def on_define_module(indexer, definition) - definition.ignored! if file_is_helper?(indexer) + sig { override.params(definition: Model::Module).void } + def on_define_module(definition) + @index.ignore(definition) if file_is_helper?(definition) end private - sig { params(indexer: Indexer).returns(T::Boolean) } - def file_is_helper?(indexer) - indexer.path.match?(%r{app/helpers/.*\.rb$}) + sig { params(symbol_def: Model::Namespace).returns(T::Boolean) } + def file_is_helper?(symbol_def) + symbol_def.location.file.match?(%r{app/helpers/.*\.rb$}) end end end end end