lib/spoom/deadcode/plugins/action_mailer_preview.rb in spoom-1.3.2 vs lib/spoom/deadcode/plugins/action_mailer_preview.rb in spoom-1.3.3
- old
+ new
@@ -7,12 +7,18 @@
class ActionMailerPreview < Base
extend T::Sig
ignore_classes_inheriting_from("ActionMailer::Preview")
- sig { override.params(indexer: Indexer, definition: Definition).void }
- def on_define_method(indexer, definition)
- definition.ignored! if indexer.nesting_class_superclass_name == "ActionMailer::Preview"
+ sig { override.params(definition: Model::Method).void }
+ def on_define_method(definition)
+ owner = definition.owner
+ return unless owner.is_a?(Model::Class)
+
+ superclass_name = owner.superclass_name
+ return unless superclass_name
+
+ @index.ignore(definition) if superclass_name == "ActionMailer::Preview"
end
end
end
end
end