diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 2e93c85..a0dc270 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -41,7 +41,7 @@ class AnnouncementsController < ApplicationController # announcements = Bulletin.where(:title.ne => "" ,:is_preview.in=>[false,nil]).can_display.is_approved.order_by(sort).filter_by_categories.filter_by_tags(OrbitHelper.page_tags) if OrbitHelper.page_categories.first == "all" - announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).is_approved.order_by(sort).filter_by_tags.page(params[:page_no]).per(OrbitHelper.page_data_count) + announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).can_display.is_approved.order_by(sort).filter_by_tags.page(params[:page_no]).per(OrbitHelper.page_data_count) else announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).is_approved.filter_by_categories.filter_by_tags.order_by(sort).page(params[:page_no]).per(OrbitHelper.page_data_count) end @@ -161,7 +161,8 @@ class AnnouncementsController < ApplicationController def show params = OrbitHelper.params - announcement = Bulletin.where(:title.ne => "").find_by(:uid=>params[:uid]) rescue nil + # announcement = Bulletin.where(:title.ne => "").find_by(:uid=>params[:uid]) rescue nil + announcement = Bulletin.find_by(:uid=>params[:uid]) if !announcement.nil? url_to_edit = OrbitHelper.user_can_edit?(announcement) ? "/admin/announcements/#{announcement.id.to_s}/edit" : "" diff --git a/app/views/admin/announcements/_index.html.erb b/app/views/admin/announcements/_index.html.erb index b35a86b..ef4238d 100644 --- a/app/views/admin/announcements/_index.html.erb +++ b/app/views/admin/announcements/_index.html.erb @@ -17,7 +17,7 @@ <%= b.status_for_table %>