From b7577c6b5ffb866111b6fe7778ce85c927cb8dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 30 Dec 2023 21:15:22 +0800 Subject: [PATCH] Fix relative link in subtitle for feed. --- app/models/bulletin.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb index a111441..d78ba3c 100644 --- a/app/models/bulletin.rb +++ b/app/models/bulletin.rb @@ -393,11 +393,15 @@ class Bulletin a["org_is_top"] = (self.is_top ? 1 : 0) a["id"] = self.uid a["title_translations"] = self.title_translations - a["subtitle_translations"] = self.subtitle_translations + a["subtitle_translations"] = {} + self.subtitle_translations.each do |l, subtitle| + a["subtitle_translations"][l] = self.class.smart_convertor(subtitle,base_url) + end a["text_translations"] = {} text_translations = self.text_translations - a["text_translations"]["en"] = self.class.smart_convertor(text_translations["en"],base_url) if !text_translations["en"].blank? - a["text_translations"]["zh_tw"] = self.class.smart_convertor(text_translations["zh_tw"],base_url) if !text_translations["zh_tw"].blank? + self.text_translations.each do |l, text| + a["text_translations"][l] = self.class.smart_convertor(text,base_url) + end a["postdate"] = self.postdate a["image_description_translations"] = self.image_description_translations a["image"] = {}