From 402562f743fda35b4b92b2b6006c6d8b35f0c250 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 2 May 2016 17:36:21 +0800 Subject: [PATCH] small fix --- 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 9d6313f..70f0518 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -238,9 +238,9 @@ class AnnouncementsController < ApplicationController def show_local_announcement(uid, is_preview) if is_preview - announcement = Bulletin.find_by(:uid => uid) + announcement = Bulletin.where(:uid => uid).first else - announcement = Bulletin.can_display.find_by(:uid => uid) + announcement = Bulletin.can_display.where(:uid => uid).first end url_to_edit = OrbitHelper.user_can_edit?(announcement) ? "/admin/announcements/#{announcement.id.to_s}/edit" : ""