small fix

This commit is contained in:
Harry Bomrah 2016-05-02 17:36:21 +08:00
parent 8490db6992
commit 402562f743
1 changed files with 2 additions and 2 deletions

View File

@ -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" : ""