small fix for title empty

This commit is contained in:
Harry Bomrah 2016-11-23 19:03:34 +08:00
parent 33fabb2634
commit 08059e2152
1 changed files with 3 additions and 3 deletions

View File

@ -133,8 +133,8 @@ class AnnouncementsController < ApplicationController
x = { x = {
"bulletin_links" => links, "bulletin_links" => links,
"bulletin_files" => files, "bulletin_files" => files,
"title" => (fa["title_translations"][locale] rescue ""), "title" => fa["title_translations"][locale],
"subtitle" => (fa["subtitle_translations"][locale] rescue ""), "subtitle" => fa["subtitle_translations"][locale],
"statuses" => [status], "statuses" => [status],
"category" => fa["category"], "category" => fa["category"],
"postdate" => fa["postdate"], "postdate" => fa["postdate"],
@ -149,7 +149,7 @@ class AnnouncementsController < ApplicationController
"more" => t(:more_plus), "more" => t(:more_plus),
"view_count" => "" "view_count" => ""
} }
if !x["title"].empty? if (!x["title"].empty? rescue false)
fans << x fans << x
end end
end end