Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Conversation

@lis2
Copy link
Contributor

@lis2 lis2 commented Mar 11, 2025

When spam scanner is enabled and code is reloaded, developer experience this error:

NameError at /posts
===================

uninitialized constant DiscourseAi::AiModeration::EntryPoint::SpamScanner

> To access an interactive console with this error, point your browser to: /__better_errors

plugins/discourse-ai/lib/ai_moderation/entry_point.rb, line 7

It is because when we call SpamScanner it is searched within parent DiscourseAi::AiModeration::EntryPoint namespace.

We can help a bit Zeitwerk by calling SpamScanner more explicitly.

When spam scanner is enabled and code is reloaded, developer experience this error:

```
NameError at /posts
===================

uninitialized constant DiscourseAi::AiModeration::EntryPoint::SpamScanner

> To access an interactive console with this error, point your browser to: /__better_errors

plugins/discourse-ai/lib/ai_moderation/entry_point.rb, line 7
```

It is because when we call `SpamScanner` it is searched within parent `DiscourseAi::AiModeration::EntryPoint` namespace.

We can help a bit Zeitwerk by calling SpamScanner more explicitly.
Copy link
Contributor

@martin-brennan martin-brennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lis2 , I appreciate it 🙏

@lis2 lis2 merged commit 3da4f5e into main Mar 11, 2025
6 checks passed
@lis2 lis2 deleted the correct-spam-path branch March 11, 2025 02:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants