Class: C80Features::ParaValidator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- C80Features::ParaValidator
- Defined in:
- app/models/c80_features/para_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/models/c80_features/para_validator.rb', line 3 def validate(record) puts "<ParaValidator.validate> record = #{record}" # unless record.title.present? # record.errors[:title] = 'Укажите заголовок' # end unless record.content.present? record.errors[:content] = 'Заполните текст' end end |