zammad/lib/validations/mention_validator.rb
2026-01-02 15:41:09 +02:00

9 lines
326 B
Ruby

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