From a5b21637a325b60ee067ca4e980184df6f6950f2 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 6 Oct 2014 17:59:40 +0800 Subject: [PATCH] fixed non title rescue --- app/controllers/announcements_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 13bbee0..61f6fd3 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -72,7 +72,6 @@ class AnnouncementsController < ApplicationController def show params = OrbitHelper.params announcement = Bulletin.can_display.find_by(:uid=>params[:uid]) - url_to_edit = OrbitHelper.user_can_edit?(announcement) ? "/admin/announcements/#{announcement.id.to_s}/edit" : "" access_level = OrbitHelper.user_access_level? @@ -85,7 +84,8 @@ class AnnouncementsController < ApplicationController "tag" => tag.name , "url" => OrbitHelper.page_for_tag(tag) } } rescue [] - files = announcement.bulletin_files.map{|file| { "file_url" => file.file.url, "file_title" => (file.title.blank? ? File.basename(file.file.path) : file.title) } } rescue [] + files = announcement.bulletin_files.map{|file| { "file_url" => file.file.url, "file_title" => (file.title.blank? ? File.basename(file.file.path) : file.title rescue '') } } rescue [] + links = announcement.bulletin_links.map{|link| { "link_url" => link.url, "link_title" => (link.title.blank? ? link.url : link.title) } } rescue [] update_user = announcement.update_user.member_profile.name rescue "" {