mention_validator.rb 326 B

123456789
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Validations::MentionValidator < ActiveModel::Validator
  3. def validate(record)
  4. return if Mention.mentionable? record.mentionable, record.user
  5. record.errors.add :base, __('A mentioned user has no agent access to this ticket')
  6. end
  7. end