Sha256: db06f425b93aba8705d93cbfee1602da77d7752e7bc31707db229e4bae1405fb

Contents?: true

Size: 569 Bytes

Versions: 11

Compression:

Stored size: 569 Bytes

Contents

module C80NewsTz
  class FactValidator < ActiveModel::Validator
    def validate(record)

      unless record.title.present?
        record.errors[:title] = 'Название публикации не может быть пустым'
      end

      # unless record.short.present?
      #   record.errors[:short] = 'Заполните краткое описание публикации'
      # end

      unless record.full.present?
        record.errors[:full] = 'Текст публикации не может быть пустым'
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
c80_news_tz-0.1.1.26 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.25 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.24 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.23 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.22 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.21 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.19 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.18 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.17 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.16 app/models/c80_news_tz/fact_validator.rb
c80_news_tz-0.1.1.15 app/models/c80_news_tz/fact_validator.rb