mention_validator.rb 309 B

123456789
  1. # Copyright (C) 2012-2023 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 :user, __('has no agent access to this ticket')
  6. end
  7. end