View Source Dropkick.Changeset (dropkick v0.0.1)
Link to this section Summary
Functions
Validates that the given field of type Dropkick.File has the allowed extensions.
This function should be considered unsafe unless you define your file fields with infer: true.
Validates that the given field of type Dropkick.File has the allowed size in bytes.
Validates that the given field of type Dropkick.File has the allowed content types.
This function should be considered unsafe unless you define your file fields with infer: true.
Link to this section Functions
Validates that the given field of type Dropkick.File has the allowed extensions.
This function should be considered unsafe unless you define your file fields with infer: true.
example
Example
validate_file_extension(changeset, :avatar, ~w(png jpg))
Validates that the given field of type Dropkick.File has the allowed size in bytes.
options
Options
:is: The file size must be exactly this value.:max: The file size must be less than this value.:min: The file size must be greater than this value.
example
Example
validate_file_size(changeset, :avatar, max: 10 * 1024 * 1024)
Validates that the given field of type Dropkick.File has the allowed content types.
This function should be considered unsafe unless you define your file fields with infer: true.
example
Example
validate_file_type(changeset, :avatar, ~w(image/jpeg image/jpeg))