|
|
|
@ -86,11 +86,11 @@ class ShixunsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
@shixuns = @shixuns.includes(:tag_repertoires, :challenges).page(page).per(limit)
|
|
|
|
|
|
|
|
|
|
@tag_name_map = TagRepertoire.joins(:shixun_tag_repertoires)
|
|
|
|
|
.where(shixun_tag_repertoires: { shixun_id: @shixuns.map(&:id) })
|
|
|
|
|
.group('shixun_tag_repertoires.shixun_id')
|
|
|
|
|
.select('shixun_id, tag_repertoires.name')
|
|
|
|
|
.each_with_object({}) { |r, obj| obj[r.shixun_id] = r.name }
|
|
|
|
|
#@tag_name_map = TagRepertoire.joins(:shixun_tag_repertoires)
|
|
|
|
|
# .where(shixun_tag_repertoires: { shixun_id: @shixuns.map(&:id) })
|
|
|
|
|
# .group('shixun_tag_repertoires.shixun_id')
|
|
|
|
|
# .select('shixun_id, tag_repertoires.name')
|
|
|
|
|
# .each_with_object({}) { |r, obj| obj[r.shixun_id] = r.name }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def shixun_list
|
|
|
|
|