diff --git a/app/models/screenshot.rb b/app/models/screenshot.rb index 792a66b..e74d21c 100644 --- a/app/models/screenshot.rb +++ b/app/models/screenshot.rb @@ -11,6 +11,7 @@ class Screenshot < ActiveRecord::Base path: ':rails_root/public/screenshots/:id_partition/:style.png', url: '/screenshots/:id_partition/:style.png' validates_attachment_content_type :image, :content_type => 'image/png' + validates_with AttachmentSizeValidator, :attributes => :image, :less_than => 5.megabytes # Return caption for full-screen screenshots. # Takes the description of a screenshot if available.