mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 12:02:05 +08:00
DEV: Update to lastest rubocop-discourse
This commit is contained in:

committed by
Loïc Guitaut

parent
3b6d4c830f
commit
2a28cda15c
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user