Sha256: d62f7e2bd330ab02d9a12e3ad8d5fc680140ef4f4d0c570f839ac6509e4943e1
Contents?: true
Size: 385 Bytes
Versions: 1
Compression:
Stored size: 385 Bytes
Contents
class AttachmentPresenceValidator < RailsUploads::Validators::Base # validates :prop, :attachment_presence => true def validate_each(record, attribute, value) if !has_default?(record, attribute) and not (value.kind_of? RailsUploads::Types::File and value.exists?) add_error record, attribute, 'errors.messages.attachment_presence' end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_uploads-0.1.4 | lib/rails_uploads/validators/attachment_presence_validator.rb |