From b6e8a135f0afbaf0288875dfa25f5c8fc3f57a11 Mon Sep 17 00:00:00 2001 From: jasder Date: Mon, 19 Apr 2021 15:42:54 +0800 Subject: [PATCH] FIX url_to_avatar bug --- app/helpers/application_helper.rb | 2 +- app/helpers/projects_helper.rb | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 18523d700..3af7a5296 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -144,7 +144,7 @@ module ApplicationHelper if File.exist?(disk_filename(source&.class, source&.id)) ctime = File.ctime(disk_filename(source.class, source.id)).to_i if %w(User Organization).include?(source.class.to_s) - File.join(relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}" + File.join("images", relative_path, ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}" else File.join("images/avatars", ["#{source.class}", "#{source.id}"]) + "?t=#{ctime}" end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index b212b50e4..aec4b38d7 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -90,8 +90,4 @@ module ProjectsHelper def render_educoder_avatar_url(project_educoder) [Rails.application.config_for(:configuration)['educoder']['cdn_url'], project_educoder&.image_url].join('/') end - - def render_avatar_url(owner) - ['images', url_to_avatar(owner)].join('/') - end end