mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Disallow c as a tag
This commit is contained in:
parent
6aff510809
commit
b2ed17cf86
@ -4,7 +4,15 @@ class Tag < ActiveRecord::Base
|
|||||||
include Searchable
|
include Searchable
|
||||||
include HasDestroyedWebHook
|
include HasDestroyedWebHook
|
||||||
|
|
||||||
validates :name, presence: true, uniqueness: { case_sensitive: false }
|
RESERVED_TAGS = [
|
||||||
|
'c'
|
||||||
|
]
|
||||||
|
|
||||||
|
validates :name,
|
||||||
|
presence: true,
|
||||||
|
uniqueness: { case_sensitive: false },
|
||||||
|
exclusion: { in: RESERVED_TAGS }
|
||||||
|
|
||||||
validate :target_tag_validator, if: Proc.new { |t| t.new_record? || t.will_save_change_to_target_tag_id? }
|
validate :target_tag_validator, if: Proc.new { |t| t.new_record? || t.will_save_change_to_target_tag_id? }
|
||||||
|
|
||||||
scope :where_name, ->(name) do
|
scope :where_name, ->(name) do
|
||||||
|
Loading…
Reference in New Issue
Block a user