Sha256: d2f1593575f296e7d8924d4635363458c2dd74d5826a4239593aa5081fe28270
Contents?: true
Size: 245 Bytes
Versions: 59
Compression:
Stored size: 245 Bytes
Contents
# validates that the title has at least one title class HasOneTitleValidator < ActiveModel::Validator def validate(record) if record.title.reject(&:empty?).empty? record.errors[:title] << "You must provide a title" end end end
Version data entries
59 entries across 59 versions & 2 rubygems