Module | Paperclip::Validate::ClassMethods |
In: |
lib/dm-paperclip/validations.rb
|
Places ActiveRecord-style validations on the content type of the file assigned. The possible options are:
# File lib/dm-paperclip/validations.rb, line 32 32: def validates_attachment_content_type(*fields) 33: opts = opts_from_validator_args(fields) 34: add_validator_to_context(opts, fields, Paperclip::Validate::ContentTypeValidator) 35: end
Places ActiveRecord-style validations on the presence of a file.
# File lib/dm-paperclip/validations.rb, line 23 23: def validates_attachment_presence(*fields) 24: opts = opts_from_validator_args(fields) 25: add_validator_to_context(opts, fields, Paperclip::Validate::RequiredFieldValidator) 26: end
Places ActiveRecord-style validations on the size of the file assigned. The possible options are:
# File lib/dm-paperclip/validations.rb, line 12 12: def validates_attachment_size(*fields) 13: opts = opts_from_validator_args(fields) 14: add_validator_to_context(opts, fields, Paperclip::Validate::SizeValidator) 15: end