This commit is contained in:
BoHung Chiu 2023-03-17 16:17:05 +08:00
parent b8bc613d23
commit 915f63b468
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ class Advising
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc",:award_date => "desc") }
def display_year
(I18n.locale.to_s == "zh_tw" ? (self.year > 1911 ? (self.year - 1911) : self.year ) : self.year)
((self.year.present? && I18n.locale.to_s == "zh_tw") ? (self.year > 1911 ? (self.year - 1911) : self.year ) : self.year)
end
def display_advising_type
(self.advising_type ? self.advising_type.title : "")