竞赛配置子赛项
This commit is contained in:
parent
6d280ed8f2
commit
6e86f9d9f3
|
@ -33,8 +33,8 @@ class SettingsController < ApplicationController
|
||||||
def get_sub_competitions
|
def get_sub_competitions
|
||||||
@sub_competitions = []
|
@sub_competitions = []
|
||||||
Site.competition.pluck(:key).uniq.each do |key|
|
Site.competition.pluck(:key).uniq.each do |key|
|
||||||
hash = {}
|
hash = {"identifier": "#{key.to_s}"}
|
||||||
hash.merge!("#{key.to_s}": Site.competition.where(key: key).select(:id, :name, :url, :key).to_a.map(&:serializable_hash))
|
hash.merge!("list": Site.competition.where(key: key).select(:id, :name, :url, :key).to_a.map(&:serializable_hash))
|
||||||
@sub_competitions << hash
|
@sub_competitions << hash
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue