FIX: use `short_path` of flair upload to get signed url for secure media.
If we use `upload.url` for secure urls then the images won't render.
This commit is contained in:
parent
2de2537595
commit
0f20a6f0aa
|
@ -750,7 +750,7 @@ class Group < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def flair_url
|
def flair_url
|
||||||
flair_icon.presence || flair_upload&.url
|
flair_icon.presence || flair_upload&.short_path
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -28,7 +28,9 @@ RSpec.describe Jobs::MigrateGroupFlairImages do
|
||||||
end.to change { Upload.count }.by(1)
|
end.to change { Upload.count }.by(1)
|
||||||
|
|
||||||
group.reload
|
group.reload
|
||||||
expect(group.flair_upload).to eq(Upload.last)
|
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(nil)
|
expect(group[:flair_url]).to eq(nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue