diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index e5204d8..b55c8e1 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -143,9 +143,9 @@ class AnnouncementsController < ApplicationController end else if devide_flag - anns = sorted_anns.sample(widget_data_count).map{|v| data_to_human_type(v)} - top_anns = anns.select{|v| v.is_top} - not_top_anns = anns.select{|v| !v.is_top} + anns = sorted_anns.sample(widget_data_count) + top_anns = anns.select{|v| v.is_top}.map{|v| data_to_human_type(v)} + not_top_anns = anns.select{|v| !v.is_top}.map{|v| data_to_human_type(v)} else anns = sorted_anns.sample(widget_data_count).map{|v| data_to_human_type(v)} end