Serve system user avatar as an asset
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 932 KiB |
@@ -8,7 +8,7 @@ class Users::AvatarsController < ApplicationController
|
||||
|
||||
def show
|
||||
if @user.system?
|
||||
redirect_to "/apple-touch-icon.png"
|
||||
redirect_to view_context.image_path("system_user.png")
|
||||
elsif @user.avatar.attached?
|
||||
redirect_to rails_blob_url(@user.avatar.variant(:thumb), disposition: "inline")
|
||||
elsif stale? @user, cache_control: cache_control
|
||||
|
||||
@@ -9,7 +9,7 @@ class Users::AvatarsControllerTest < ActionDispatch::IntegrationTest
|
||||
get user_avatar_path(users(:system))
|
||||
|
||||
assert_response :redirect
|
||||
assert_redirected_to "/apple-touch-icon.png"
|
||||
assert_redirected_to ActionController::Base.helpers.image_path("system_user.png")
|
||||
end
|
||||
|
||||
test "show own initials without caching" do
|
||||
|
||||
Reference in New Issue
Block a user