From 5946031125157a47f44f8b7af12aed378c0e5f5b Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 18 Jun 2014 17:59:03 +0800 Subject: [PATCH] modified chinese status class problem --- app/controllers/announcements_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 5672f8b..dbcde3a 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -3,10 +3,10 @@ class AnnouncementsController < ApplicationController def index announcements = Bulletin.where(:is_preview.in=>[false,nil]).can_display.order_by(:created_at=>'desc').filter_by_categories anns = announcements.collect do |a| - statuses = a.statuses.collect do |status| + statuses = a.statuses_with_classname.collect do |status| { - "status" => status, - "status-class" => "status-#{status.downcase}" + "status" => status["name"], + "status-class" => "status-#{status['classname']}" } end { @@ -30,10 +30,10 @@ class AnnouncementsController < ApplicationController def widget announcements = Bulletin.where(:is_preview.in=>[false,nil]).can_display.order_by(:created_at=>'desc').filter_by_widget_categories anns = announcements.collect do |a| - statuses = a.statuses.collect do |status| + statuses = a.statuses_with_classname.collect do |status| { - "status" => status, - "status-class" => "status-#{status.downcase}" + "status" => status["name"], + "status-class" => "status-#{status['classname']}" } end {