mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Use an options hash instead of boolean parameters
This commit is contained in:
@@ -46,13 +46,10 @@ class Upload < ActiveRecord::Base
|
||||
thumbnail(width, height).present?
|
||||
end
|
||||
|
||||
def create_thumbnail!(width, height, crop = false)
|
||||
def create_thumbnail!(width, height, opts = nil)
|
||||
return unless SiteSetting.create_thumbnails?
|
||||
|
||||
opts = {
|
||||
allow_animation: SiteSetting.allow_animated_thumbnails,
|
||||
crop: crop
|
||||
}
|
||||
opts ||= {}
|
||||
opts[:allow_animation] = SiteSetting.allow_animated_thumbnails
|
||||
|
||||
if get_optimized_image(width, height, opts)
|
||||
save(validate: false)
|
||||
|
||||
Reference in New Issue
Block a user