-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix identifiers in views to not preload for belongs_to IDs
- Loading branch information
Showing
29 changed files
with
63 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
defmodule CodeCorpsWeb.GithubPullRequestView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:github_repo] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:github_created_at, :github_updated_at, :html_url, :merged, :number, :state] | ||
|
||
has_one :github_repo, serializer: CodeCorpsWeb.GithubRepoView | ||
has_one :github_repo, type: "github-repo", field: :github_repo_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
defmodule CodeCorpsWeb.GithubRepoView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:github_app_installation] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:github_account_avatar_url, :github_account_id, | ||
:github_account_login, :github_account_type, :github_id, :inserted_at, | ||
:name, :updated_at] | ||
|
||
has_one :github_app_installation, serializer: CodeCorpsWeb.GithubAppInstallationView | ||
has_one :github_app_installation, type: "github-app-installation", field: :github_app_installation_id | ||
end |
5 changes: 2 additions & 3 deletions
5
lib/code_corps_web/views/organization_github_app_installation_view.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
defmodule CodeCorpsWeb.OrganizationGithubAppInstallationView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:github_app_installation, :organization] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:inserted_at, :updated_at] | ||
|
||
has_one :github_app_installation, serializer: CodeCorpsWeb.GithubAppInstallationView | ||
has_one :organization, serializer: CodeCorpsWeb.OrganizationView | ||
has_one :github_app_installation, type: "github-app-installation", field: :github_app_installation_id | ||
has_one :organization, type: "organization", field: :organization_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
defmodule CodeCorpsWeb.PreviewView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:user] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:markdown, :body, :inserted_at, :updated_at] | ||
|
||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :user, type: "user", field: :user_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.ProjectCategoryView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:project, :category] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :project, serializer: CodeCorpsWeb.ProjectView | ||
has_one :category, serializer: CodeCorpsWeb.CategoryView | ||
has_one :project, type: "project", field: :project_id | ||
has_one :category, type: "category", field: :category_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.ProjectGithubRepoView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:github_repo, :project] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :github_repo, serializer: CodeCorpsWeb.GithubRepoView | ||
has_one :project, serializer: CodeCorpsWeb.ProjectView | ||
has_one :github_repo, type: "github-repo", field: :github_repo_id | ||
has_one :project, type: "project", field: :project_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.ProjectSkillView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:project, :skill] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :project, serializer: CodeCorpsWeb.ProjectView | ||
has_one :skill, serializer: CodeCorpsWeb.SkillView | ||
has_one :project, type: "project", field: :project_id | ||
has_one :skill, type: "skill", field: :skill_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
defmodule CodeCorpsWeb.ProjectUserView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:project, :user] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:role, :inserted_at, :updated_at] | ||
|
||
has_one :project, serializer: CodeCorpsWeb.ProjectView | ||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :project, type: "project", field: :project_id | ||
has_one :user, type: "user", field: :user_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.RoleSkillView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:role, :skill] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :role, serializer: CodeCorpsWeb.RoleView | ||
has_one :skill, serializer: CodeCorpsWeb.SkillView | ||
has_one :role, type: "role", field: :role_id | ||
has_one :skill, type: "skill", field: :skill_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
defmodule CodeCorpsWeb.SluggedRouteView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:organization, :user] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:slug, :inserted_at, :updated_at] | ||
|
||
has_one :organization, serializer: CodeCorpsWeb.OrganizationView | ||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :organization, type: "organization", field: :organization_id | ||
has_one :user, type: "user", field: :user_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
defmodule CodeCorpsWeb.StripeConnectPlanView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:project] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:amount, :created, :id_from_stripe, :inserted_at, :name, :updated_at] | ||
|
||
has_one :project, serializer: CodeCorpsWeb.ProjectView | ||
has_one :project, type: "project", field: :project_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
defmodule CodeCorpsWeb.StripeConnectSubscriptionView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:user, :project] | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:project] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:quantity, :inserted_at, :updated_at] | ||
|
||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :user, type: "user", field: :user_id | ||
has_one :project, serializer: CodeCorpsWeb.ProjectView, through: [:stripe_connect_plan, :project] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
defmodule CodeCorpsWeb.StripePlatformCardView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:user] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:brand, :exp_month, :exp_year, :token, :last4, :name] | ||
|
||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :user, type: "user", field: :user_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
defmodule CodeCorpsWeb.TaskListView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:project, :tasks] | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:tasks] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
attributes [:inbox, :name, :order, :inserted_at, :updated_at] | ||
|
||
has_one :project, serializer: CodeCorpsWeb.ProjectView | ||
has_one :project, type: "project", field: :project_id | ||
|
||
has_many :tasks, serializer: CodeCorpsWeb.TaskView, identifiers: :always | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.TaskSkillView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:task, :skill] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :task, serializer: CodeCorpsWeb.TaskView | ||
has_one :skill, serializer: CodeCorpsWeb.SkillView | ||
has_one :task, type: "task", field: :task_id | ||
has_one :skill, type: "skill", field: :skill_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.UserCategoryView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:user, :category] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :category, serializer: CodeCorpsWeb.CategoryView | ||
has_one :user, type: "user", field: :user_id | ||
has_one :category, type: "category", field: :category_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.UserRoleView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:user, :role] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :role, serializer: CodeCorpsWeb.RoleView | ||
has_one :user, type: "user", field: :user_id | ||
has_one :role, type: "role", field: :role_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.UserSkillView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:user, :skill] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :skill, serializer: CodeCorpsWeb.SkillView | ||
has_one :user, type: "user", field: :user_id | ||
has_one :skill, type: "skill", field: :skill_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule CodeCorpsWeb.UserTaskView do | ||
@moduledoc false | ||
use CodeCorpsWeb.PreloadHelpers, default_preloads: [:task, :user] | ||
use CodeCorpsWeb, :view | ||
use JaSerializer.PhoenixView | ||
|
||
has_one :task, serializer: CodeCorpsWeb.TaskView | ||
has_one :user, serializer: CodeCorpsWeb.UserView | ||
has_one :task, type: "task", field: :task_id | ||
has_one :user, type: "user", field: :user_id | ||
end |
Oops, something went wrong.