change map id to pluck to accelerate mapping
This commit is contained in:
parent
38022023e0
commit
e9f21006b0
|
@ -129,7 +129,7 @@ class AnnouncementsController < ApplicationController
|
||||||
if anns_cache.count > 1
|
if anns_cache.count > 1
|
||||||
anns_cache.destroy
|
anns_cache.destroy
|
||||||
end
|
end
|
||||||
AnnsCache.create(parent_id: subpart.id,locale: I18n.locale.to_s,filter_result: sorted_anns.map{|v| v.id})
|
AnnsCache.create(parent_id: subpart.id,locale: I18n.locale.to_s,filter_result: sorted_anns.pluck(:id))
|
||||||
else
|
else
|
||||||
sorted_anns = sorted_anns.sample(widget_data_count)
|
sorted_anns = sorted_anns.sample(widget_data_count)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue