Added size limit of 5 MB for screenshots

This commit is contained in:
Christoph Haas 2015-04-27 00:20:10 +02:00
parent 7e1bf0d152
commit 9377af7795

View file

@ -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.