DEV: Update to lastest rubocop-discourse

This commit is contained in:
Loïc Guitaut
2024-05-27 12:27:13 +02:00
committed by Loïc Guitaut
parent 3b6d4c830f
commit 2a28cda15c
164 changed files with 269 additions and 263 deletions

View File

@ -69,6 +69,6 @@ class FormTemplateYamlValidator < ActiveModel::Validator
record.errors.add(:template, I18n.t("form_templates.errors.duplicate_ids"))
end
existing_ids << field["id"] unless field["id"].blank?
existing_ids << field["id"] if field["id"].present?
end
end

View File

@ -39,7 +39,7 @@ class PostValidator < ActiveModel::Validator
if private_message?(post)
SiteSetting.private_message_post_length
elsif post.is_first_post? || (post.topic.present? && post.topic.posts_count == 0)
if post.topic&.featured_link&.present?
if post.topic&.featured_link.present?
(0..SiteSetting.max_post_length)
else
SiteSetting.first_post_length

View File

@ -78,7 +78,7 @@ class UploadValidator < ActiveModel::Validator
.gsub(/[\s\.]+/, "")
.downcase
.split("|")
.each { |extension| extensions << extension unless extension.include?("*") }
.each { |extension| extensions << extension if extension.exclude?("*") }
extensions
end