Class: Gitlab::EmojiNameValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Gitlab::EmojiNameValidator
- Defined in:
- app/validators/gitlab/emoji_name_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
13 14 15 16 17 18 |
# File 'app/validators/gitlab/emoji_name_validator.rb', line 13 def validate_each(record, attribute, value) return if valid_tanuki_emoji?(value) return if valid_custom_emoji?(record, value) record.errors.add(attribute, ([:message] || 'is not a valid emoji name')) end |