mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
`NodeType` exposed six of its filter helpers twice: a class method holding the implementation, and a private instance method whose entire body forwarded to it. Three of those pairs existed for no reason - nothing in either plugin called `matches_category_ids?`, `matches_user_groups?` or `matches_reviewable_types?` at class level. The pairs are not pointless in general. `stale_topic` filters from `self.trigger_data_for` rather than from an instance, so `category_ids_parameter`, `normalize_tag_names`, `normalize_category_ids` and `expand_subcategory_ids` genuinely need a class form and keep it. The rule is "a class method when a class method needs it", and these three were the exceptions to it. Their spec reached for the class form because that was the only public way in; it now exercises them through a node, which is how nodes use them.