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

Post to groups #66

Merged
merged 15 commits into from May 21, 2018
Merged

Post to groups #66

merged 15 commits into from May 21, 2018

Conversation

derrickreimer
Copy link
Owner

Fixes #64

@@ -194,4 +210,19 @@ defmodule Level.Groups do
|> Ecto.Changeset.change(state: "CLOSED")
|> Repo.update()
end

@doc false
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing you might consider here is using the @impl true annotation (and in other places where you're implementing this behaviour). That's when you're specifying which functions are implementations of behaviour callbacks. You can read a bit more about @impl in the 1.5 release notes: https://elixir-lang.org/blog/2017/07/25/elixir-v1-5-0-released/ and in the issue around its addition to the language: elixir-lang/elixir#5734

Copy link
Owner Author

Choose a reason for hiding this comment

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

🤩 this is great!

def create_post(space_user, params) do
@spec post_to_group(SpaceUser.t(), Group.t(), map()) :: post_to_group_result()
def post_to_group(space_user, group, params) do
Multi.new()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice use of Ecto.Multi! Looks like all this Elixir-ing is paying off.

@derrickreimer derrickreimer merged commit 6ddcd5e into master May 21, 2018
@derrickreimer derrickreimer deleted the post-to-groups branch May 21, 2018 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants