simplify code
This commit is contained in:
parent
0e414d0890
commit
58a53017c9
|
@ -278,8 +278,9 @@ class Report
|
||||||
.order('COUNT(DISTINCT ip_address) DESC, COUNT(*) DESC')
|
.order('COUNT(DISTINCT ip_address) DESC, COUNT(*) DESC')
|
||||||
.limit(20).to_a
|
.limit(20).to_a
|
||||||
|
|
||||||
label = Proc.new { |key| I18n.t("reports.trending_search.labels.#{key}") }
|
report.labels = [:term, :searches, :unique].map { |key|
|
||||||
report.labels = [:term, :searches, :unique].map {|key| label.call(key) }
|
I18n.t("reports.trending_search.labels.#{key}")
|
||||||
|
}
|
||||||
|
|
||||||
trends.each do |trend|
|
trends.each do |trend|
|
||||||
report.data << [trend.term, trend.searches, trend.unique]
|
report.data << [trend.term, trend.searches, trend.unique]
|
||||||
|
|
Loading…
Reference in New Issue