Class: C80NewsTz::CommentValidator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- C80NewsTz::CommentValidator
- Defined in:
- app/models/c80_news_tz/comment_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
3 4 5 6 7 |
# File 'app/models/c80_news_tz/comment_validator.rb', line 3 def validate(record) unless record..present? record.errors[:message] = 'Сообщение не может быть пустым.' end end |