Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/abuse_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

validate :check_for_spam
def check_for_spam
return unless %w(staging production).include?(Rails.env)

Check warning on line 29 in app/models/abuse_report.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 `%w`-literals should be delimited by `[` and `]`. Raw Output: app/models/abuse_report.rb:29:19: C: Style/PercentLiteralDelimiters: `%w`-literals should be delimited by `[` and `]`.

Check warning on line 29 in app/models/abuse_report.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 Add empty line after guard clause. Raw Output: app/models/abuse_report.rb:29:5: C: Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
approved = logged_in_with_matching_email? || !Akismetor.spam?(akismet_attributes)
errors.add(:base, ts("This report looks like spam to our system!")) unless approved
end
Expand Down
1 change: 1 addition & 0 deletions app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
validate :check_for_spam, on: :create

def check_for_spam
return unless %w(staging production).include?(Rails.env)

Check warning on line 68 in app/models/comment.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 `%w`-literals should be delimited by `[` and `]`. Raw Output: app/models/comment.rb:68:19: C: Style/PercentLiteralDelimiters: `%w`-literals should be delimited by `[` and `]`.

Check warning on line 68 in app/models/comment.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 Add empty line after guard clause. Raw Output: app/models/comment.rb:68:5: C: Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
Copy link
Contributor

@Bilka2 Bilka2 Jan 16, 2026

Choose a reason for hiding this comment

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

The spam? method already skips spamchecking if we're not in Staging or Production, so this check is redundant. Could you please remove it?

(I think removing this should also fix the tests)

self.spam = !skip_spamcheck? && spam?
self.approved = !self.spam

Expand Down
1 change: 1 addition & 0 deletions app/models/feedback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

validate :check_for_spam
def check_for_spam
return unless %w(staging production).include?(Rails.env)

Check warning on line 17 in app/models/feedback.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 `%w`-literals should be delimited by `[` and `]`. Raw Output: app/models/feedback.rb:17:19: C: Style/PercentLiteralDelimiters: `%w`-literals should be delimited by `[` and `]`.

Check warning on line 17 in app/models/feedback.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 Add empty line after guard clause. Raw Output: app/models/feedback.rb:17:5: C: Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
approved = logged_in_with_matching_email? || !Akismetor.spam?(akismet_attributes)
errors.add(:base, ts("This report looks like spam to our system!")) unless approved
end
Expand Down
4 changes: 2 additions & 2 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,8 @@ SUPPORTED_CSS_KEYWORDS: ["!important", "url"]
SUPPORTED_EXTERNAL_URLS: ["jpg", "jpeg", "png", "gif"]

# variables for Askimet http://akismet.com/
AKISMET_KEY: '6833ee7298cf'
AKISMET_NAME: 'http://transformativeworks.org'
AKISMET_KEY: ''
AKISMET_NAME: ''

# Abuse and Support ticket trackers; you may need to change
# feedbacks_controller.rb and abuse_reports_controller.rb
Expand Down
Loading