Class: C80NewsTz::CommentValidator

Inherits:
ActiveModel::Validator
  • Object
show all
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.message.present?
    record.errors[:message] = 'Сообщение не может быть пустым.'
  end
end