2021-06-24 12:36:16 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-05-04 18:17:50 +02:00
|
|
|
json.user_trainings @user_trainings do |user_training|
|
2021-06-24 12:36:16 +02:00
|
|
|
json.extract! user_training, :id, :training_id, :updated_at, :created_at
|
2016-05-04 18:17:50 +02:00
|
|
|
|
2021-06-24 12:36:16 +02:00
|
|
|
if user_training.association(:statistic_profile).loaded?
|
|
|
|
json.user_id user_training.statistic_profile.user_id
|
|
|
|
unless user_training.statistic_profile.user.nil?
|
|
|
|
json.user do
|
|
|
|
json.partial! 'open_api/v1/users/user', user: user_training.statistic_profile.user
|
|
|
|
end
|
2016-05-04 18:17:50 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if user_training.association(:training).loaded?
|
|
|
|
json.training do
|
|
|
|
json.partial! 'open_api/v1/trainings/training', training: user_training.training
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|