dev_sync_trustie
cxt 5 years ago
parent 5f5cfb4c24
commit e4fec1f0c2

@ -3,7 +3,7 @@ class CompetitionModule < ApplicationRecord
belongs_to :competition
has_many :competition_module_md_contents, dependent: :destroy
has_one :competition_module_md_content, dependent: :destroy
def module_url
result_url = url.present? ? url : case module_type

@ -5,6 +5,7 @@ class CompetitionStage < ApplicationRecord
has_many :competition_entries, dependent: :destroy
has_many :competition_scores, dependent: :destroy
has_one :competition_module_md_content, dependent: :destroy
has_one :chart_rule, dependent: :destroy
def min_start_time

@ -1,7 +1,8 @@
json.extract! @module, :id, :name, :position, :url
mds = @module.competition_module_md_contents
json.md_contents mds.each do |md|
md = @module.competition_module_md_content
if md.present?
json.md_id md.id
json.md_name md.name
json.md_content md.content
json.competition_stage_id md.competition_stage_id

Loading…
Cancel
Save