Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename controllers context #54

Merged
merged 4 commits into from
Oct 13, 2022
Merged

Conversation

fabriziosestito
Copy link
Member

Rename controller actions and context to be as close as possible to Phoenix standards, so we can use the resource directive in the router.

Base automatically changed from refactor_execution_result to main October 13, 2022 08:24
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

%Result{
execution_id: execution_id,
group_id: group_id
} = result
) do
Wanda.Repo.insert!(%ExecutionResult{
Repo.insert!(%ExecutionResult{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't have Credo warned us about this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credo warns only if it is nested 2 or 3 levels.
Sometimes it is useful to alias with one level of nesting, for example when you have overlapping module names from different "contexts". This is not the case, tho.

"""
@spec save_result(Result.t()) :: ExecutionResult.t()
def save_result(
@spec create_execution_result(Result.t()) :: ExecutionResult.t()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the strange this is that we sillt use ExecutionResult

@@ -13,7 +13,7 @@
execution_id = "00000000-0000-0000-0000-000000000001"
group_id = "00000000-0000-0000-0000-000000000002"

Wanda.Results.save_result(%Wanda.Execution.Result{
Wanda.Results.create_execution_result(%Wanda.Execution.Result{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should start considering at some point to remove this seed

@fabriziosestito fabriziosestito merged commit c4f0a80 into main Oct 13, 2022
@fabriziosestito fabriziosestito deleted the rename_controllers_context branch October 13, 2022 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants