diff --git a/app/models/topic.rb b/app/models/topic.rb index 54c7ffc019d..7ee0ea40715 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -95,6 +95,7 @@ class Topic < ActiveRecord::Base return nil unless SiteSetting.create_thumbnails return nil unless original = image_upload return nil unless original.width && original.height + extra_sizes = [] unless extra_sizes.kind_of?(Array) (Topic.thumbnail_sizes + extra_sizes).each do |dim| TopicThumbnail.find_or_create_for!(original, max_width: dim[0], max_height: dim[1]) diff --git a/spec/models/topic_thumbnail_spec.rb b/spec/models/topic_thumbnail_spec.rb index b9e1df75fd1..84c8298a824 100644 --- a/spec/models/topic_thumbnail_spec.rb +++ b/spec/models/topic_thumbnail_spec.rb @@ -7,7 +7,7 @@ describe "TopicThumbnail" do before do SiteSetting.create_thumbnails = true - topic.generate_thumbnails! + topic.generate_thumbnails!(extra_sizes: nil) TopicThumbnail.ensure_consistency! topic.reload