Sha256: 7f2800045d18e50944c94a7db64e79041ed3d07e48e44dea3c4261a86a3e49b2
Contents?: true
Size: 402 Bytes
Versions: 50
Compression:
Stored size: 402 Bytes
Contents
require "active_model" module ActiveModel module Validations # Validates that a file is attached # # Example: # # validates :logo, attached: true # class AttachedValidator < EachValidator def validate_each(record, attribute, value) record.errors.add(attribute, (options[:message] || "must be attached")) unless value.attached? end end end end
Version data entries
50 entries across 50 versions & 1 rubygems