FIX: Don't validate channel slug if it hasn't changed (#19498)

This is generating lots of log noise for operations that aren't even
touching the slug.
This commit is contained in:
Daniel Waterworth 2022-12-19 12:11:51 -06:00 committed by GitHub
parent 155c400ec7
commit d244eb0d7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ class ChatChannel < ActiveRecord::Base
},
presence: true,
allow_nil: true
validate :ensure_slug_ok
validate :ensure_slug_ok, if: :slug_changed?
before_validation :generate_auto_slug
scope :public_channels,