Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/algora/activities/activities.ex
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ defmodule Algora.Activities do
@tables Map.keys(@schema_from_table)
@user_attributes Map.keys(@table_from_user_relation)

def schema_from_table(name) when is_binary(name), do: name |> String.to_atom() |> schema_from_table()
def schema_from_table(name) when is_binary(name), do: name |> String.to_existing_atom() |> schema_from_table()

def schema_from_table(name) when is_atom(name) do
Map.fetch!(@schema_from_table, name)
end

def table_from_schema(name) when is_binary(name), do: name |> String.to_atom() |> table_from_schema()
def table_from_schema(name) when is_binary(name), do: name |> String.to_existing_atom() |> table_from_schema()

def table_from_schema(name) when is_atom(name) do
Map.fetch!(@table_from_schema, name)
Expand Down
Loading