Skip to content

Instantly share code, notes, and snippets.

@bogdanRada
Forked from mihaic195/model.rb
Created February 25, 2022 11:04
Show Gist options
  • Save bogdanRada/41345b9a95205d1f15fdf4c71aa43a14 to your computer and use it in GitHub Desktop.
Save bogdanRada/41345b9a95205d1f15fdf4c71aa43a14 to your computer and use it in GitHub Desktop.
Example of paperclip model validation
validates_attachment :avatar, presence: true,
content_type: "image/jpeg",
size: { in: 0..10.kilobytes }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment