From 212530361b2caa9c313f23061daa0091fed95dc4 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 28 May 2020 15:33:56 +0800 Subject: [PATCH] fix error --- app/controllers/announcements_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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