retrospring/app/uploaders/profile_picture_uploader.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
352 B
Ruby
Raw Permalink Normal View History

2020-05-02 18:45:11 +02:00
class ProfilePictureUploader < BaseUploader
2020-05-02 00:43:46 +02:00
def default_url(*args)
"/images/#{[version_name || args.first, 'no_avatar.png'].compact.join('/')}"
2020-05-02 00:43:46 +02:00
end
version :large do
process resize_to_fit: [500, 500]
end
version :medium do
process resize_to_fit: [256, 256]
end
version :small do
process resize_to_fit: [80, 80]
end
end