Sha256: 87c6c4ee7ca9a85b4a8e542127b51b6f50fc58b5a18320809b3486b384ec50e2
Contents?: true
Size: 307 Bytes
Versions: 25
Compression:
Stored size: 307 Bytes
Contents
# frozen_string_literal: true module Hyrax # validates that the title has at least one title class HasOneTitleValidator < ActiveModel::Validator def validate(record) return unless record.title.reject(&:empty?).empty? record.errors[:title] << "You must provide a title" end end end
Version data entries
25 entries across 25 versions & 1 rubygems