Commit 723a60610bcf91ad1ef512e50a013c239a71f12f

Authored by Braulio Bhavamitra
2 parents 6781aeb3 24083e66

Merge branch 'thumb-fail' into 'master'

Makes max_size uniform between UploadedFile and Thumbnail

closes #152

See merge request !804
app/models/thumbnail.rb
@@ -5,7 +5,7 @@ class Thumbnail < ActiveRecord::Base @@ -5,7 +5,7 @@ class Thumbnail < ActiveRecord::Base
5 attr_accessible :content_type, :filename, :thumbnail_resize_options, :thumbnail, :parent_id 5 attr_accessible :content_type, :filename, :thumbnail_resize_options, :thumbnail, :parent_id
6 6
7 has_attachment :storage => :file_system, 7 has_attachment :storage => :file_system,
8 - :content_type => :image, :max_size => 5.megabytes, processor: 'Rmagick' 8 + :content_type => :image, :max_size => UploadedFile.max_size, processor: 'Rmagick'
9 validates_as_attachment 9 validates_as_attachment
10 10
11 sanitize_filename 11 sanitize_filename
db/migrate/20160309120350_generate_missed_thumbnails.rb 0 → 100644
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
  1 +class GenerateMissedThumbnails < ActiveRecord::Migration
  2 + def up
  3 + UploadedFile.find_each {|f| f.create_thumbnails if f.thumbnails.empty? }
  4 + end
  5 +end