Sha256: f357c8baf34f45869ac2f1948236cba949c297d07f621568425a64cc774a14b6

Contents?: true

Size: 400 Bytes

Versions: 6

Compression:

Stored size: 400 Bytes

Contents

module C80Features
  class ParaValidator < ActiveModel::Validator
    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
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
c80_features-0.1.3.2 app/models/c80_features/para_validator.rb
c80_features-0.1.3.1 app/models/c80_features/para_validator.rb
c80_features-0.1.3 app/models/c80_features/para_validator.rb
c80_features-0.1.2 app/models/c80_features/para_validator.rb
c80_features-0.1.1 app/models/c80_features/para_validator.rb
c80_features-0.1.0 app/models/c80_features/para_validator.rb