diff --git a/lib/code_corps_web/controllers/task_controller.ex b/lib/code_corps_web/controllers/task_controller.ex index e5954bbb2..d7f2712cc 100644 --- a/lib/code_corps_web/controllers/task_controller.ex +++ b/lib/code_corps_web/controllers/task_controller.ex @@ -62,7 +62,7 @@ defmodule CodeCorpsWeb.TaskController do end end - @preloads [:comments, :github_pull_request, :task_skills, :user_task] + @preloads [:comments, :github_pull_request, :task_skills, :user, [user_task: :user]] def preload(data) do timing("TaskController", "preload") do diff --git a/lib/code_corps_web/views/project_view.ex b/lib/code_corps_web/views/project_view.ex index 009491d1c..6ce94d29b 100644 --- a/lib/code_corps_web/views/project_view.ex +++ b/lib/code_corps_web/views/project_view.ex @@ -14,14 +14,15 @@ defmodule CodeCorpsWeb.ProjectView do :total_monthly_donated, :updated_at, :website ] - has_one :organization, serializer: CodeCorpsWeb.OrganizationView, include: true + has_one :organization, type: "organization", field: :organization_id has_one :stripe_connect_plan, serializer: CodeCorpsWeb.StripeConnectPlanView has_many :donation_goals, serializer: CodeCorpsWeb.DonationGoalView, identifiers: :always - has_many :project_categories, serializer: CodeCorpsWeb.ProjectCategoryView, include: true + has_many :project_categories, serializer: CodeCorpsWeb.ProjectCategoryView, identifiers: :always has_many :project_github_repos, serializer: CodeCorpsWeb.ProjectGithubRepoView, identifiers: :always - has_many :project_skills, serializer: CodeCorpsWeb.ProjectSkillView, include: true - has_many :project_users, serializer: CodeCorpsWeb.ProjectUserView, include: true + has_many :project_skills, serializer: CodeCorpsWeb.ProjectSkillView, identifiers: :always + has_many :project_users, serializer: CodeCorpsWeb.ProjectUserView, identifiers: :always + has_many :tasks, serializer: CodeCorpsWeb.TaskView, identifiers: :always has_many :task_lists, serializer: CodeCorpsWeb.TaskListView, identifiers: :always def can_activate_donations(project, _conn) do diff --git a/lib/code_corps_web/views/task_list_view.ex b/lib/code_corps_web/views/task_list_view.ex index b548eec92..63bb18cb6 100644 --- a/lib/code_corps_web/views/task_list_view.ex +++ b/lib/code_corps_web/views/task_list_view.ex @@ -7,5 +7,5 @@ defmodule CodeCorpsWeb.TaskListView do has_one :project, type: "project", field: :project_id - has_many :tasks, serializer: CodeCorpsWeb.TaskInListView, include: true + has_many :tasks, serializer: CodeCorpsWeb.TaskView, identifiers: :always end