FIX: Group#flair_url must be a real URL (#11400)

It used to be a short URL, but that did not work with the lightbox
in {{image-uploader}}.
This commit is contained in:
Bianca Nenciu 2020-12-07 13:35:41 +02:00 committed by GitHub
parent da74b3e14b
commit ed52577e1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -750,7 +750,7 @@ class Group < ActiveRecord::Base
end
def flair_url
flair_icon.presence || flair_upload&.short_path
flair_icon.presence || flair_upload&.url
end
[:muted, :regular, :tracking, :watching, :watching_first_post].each do |level|

View File

@ -30,7 +30,7 @@ RSpec.describe Jobs::MigrateGroupFlairImages do
group.reload
upload = Upload.last
expect(group.flair_upload).to eq(upload)
expect(group.flair_url).to eq(upload.short_path)
expect(group.flair_url).to eq(upload.url)
expect(group[:flair_url]).to eq(nil)
end