Skip to content

Commit a3208e4

Browse files
committed
Flatten out GitHub.Sync.User to Sync.User and Sync.GithubUser
1 parent 8922d97 commit a3208e4

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

lib/code_corps/github/sync/github_comment/github_comment.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ defmodule CodeCorps.GitHub.Sync.GithubComment do
5050
"""
5151
@spec create_or_update_comment(GithubRepo.t, map) :: result
5252
def create_or_update_comment(%GithubRepo{} = github_repo, %{"id" => _, "issue_url" => _} = attrs) do
53-
with {:ok, %GithubUser{} = github_user} <- Sync.User.GithubUser.create_or_update_github_user(attrs),
53+
with {:ok, %GithubUser{} = github_user} <- Sync.GithubUser.create_or_update_github_user(attrs),
5454
{:ok, %GithubComment{} = github_comment} <- do_create_or_update_comment(github_repo, attrs, github_user) do
5555
{:ok, github_comment}
5656
else

lib/code_corps/github/sync/github_issue/github_issue.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ defmodule CodeCorps.GitHub.Sync.GithubIssue do
3131
"""
3232
@spec create_or_update_issue(map, GithubRepo.t, GithubPullRequest.t | nil) :: result
3333
def create_or_update_issue(%{} = payload, %GithubRepo{} = github_repo, github_pull_request \\ nil) do
34-
with {:ok, %GithubUser{} = github_user} <- Sync.User.GithubUser.create_or_update_github_user(payload) do
34+
with {:ok, %GithubUser{} = github_user} <- Sync.GithubUser.create_or_update_github_user(payload) do
3535
payload
3636
|> find_or_init()
3737
|> GithubIssue.changeset(payload |> Adapters.Issue.to_issue())

lib/code_corps/github/sync/user/github_user.ex renamed to lib/code_corps/github/sync/github_user/github_user.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
defmodule CodeCorps.GitHub.Sync.User.GithubUser do
1+
defmodule CodeCorps.GitHub.Sync.GithubUser do
22
@moduledoc ~S"""
33
In charge of syncing to a `GithubUser` record given a GitHub API payload
44
containing the user.

lib/code_corps/github/sync/pull_request/pull_request.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ defmodule CodeCorps.GitHub.Sync.PullRequest do
3232
"""
3333
@spec create_or_update_pull_request(map, GithubRepo.t()) :: linking_result
3434
def create_or_update_pull_request(%{} = payload, %GithubRepo{} = github_repo) do
35-
with {:ok, %GithubUser{} = github_user} <- Sync.User.GithubUser.create_or_update_github_user(payload) do
35+
with {:ok, %GithubUser{} = github_user} <- Sync.GithubUser.create_or_update_github_user(payload) do
3636

3737
attrs = to_params(payload, github_repo, github_user)
3838

lib/code_corps/github/sync/sync.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ defmodule CodeCorps.GitHub.Sync do
477477
{:ok, _comments} <- comment_payloads |> Enum.map(&Sync.GithubComment.create_or_update_comment(repo, &1)) |> ResultAggregator.aggregate |> sync_step(:sync_comments),
478478
repo <- GithubRepo |> Repo.get(repo.id) |> preload_github_repo(),
479479
{:ok, repo} <- repo |> mark_repo("syncing_users"),
480-
{:ok, _users} <- repo |> Sync.User.User.sync_github_repo() |> sync_step(:sync_users),
480+
{:ok, _users} <- repo |> Sync.User.sync_github_repo() |> sync_step(:sync_users),
481481
{:ok, repo} <- repo |> mark_repo("syncing_tasks"),
482482
{:ok, _tasks} <- repo |> Sync.Task.sync_github_repo() |> sync_step(:sync_tasks),
483483
{:ok, repo} <- repo |> mark_repo("syncing_comments"),

lib/code_corps/github/sync/user/user.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
defmodule CodeCorps.GitHub.Sync.User.User do
1+
defmodule CodeCorps.GitHub.Sync.User do
22
@moduledoc ~S"""
33
In charge of finding or creating a `User` given a `GithubUser`.
44
"""

0 commit comments

Comments
 (0)