Spec fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-10-05 17:43:45 +02:00
parent 76bc409f68
commit dee7c58449
33 changed files with 193 additions and 234 deletions

View File

@@ -115,13 +115,13 @@ defmodule Mobilizon.Discussions.Comment do
@doc """
Checks whether an comment can be managed.
"""
@spec can_be_managed_by(t, integer | String.t()) :: boolean
def can_be_managed_by(%__MODULE__{actor_id: creator_actor_id}, actor_id)
@spec can_be_managed_by?(t, integer | String.t()) :: boolean()
def can_be_managed_by?(%__MODULE__{actor_id: creator_actor_id}, actor_id)
when creator_actor_id == actor_id do
{:comment_can_be_managed, true}
creator_actor_id == actor_id
end
def can_be_managed_by(_comment, _actor), do: {:comment_can_be_managed, false}
def can_be_managed_by?(_comment, _actor), do: false
defp common_changeset(%__MODULE__{} = comment, attrs) do
comment