Skip to content

Commit

Permalink
Simplify type check / pattern matching
Browse files Browse the repository at this point in the history
Co-authored-by: R. Miles McCain <[email protected]>
  • Loading branch information
noah-schechter and milesmcc authored Dec 29, 2024
1 parent 5a2403a commit df7a9aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform/lib/platform/updates.ex
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ defmodule Platform.Updates do
@doc """
Helper API function that takes attribute change information and uses it to create an Update changeset. Requires 'explanation' to be in attrs.
"""
def change_from_media_creation(%Media{} = media, user_or_token) when is_struct(user_or_token, User) or is_struct(user_or_token, APIToken) do
def change_from_media_creation(%Media{} = media, %_{} = user_or_token) when user_or_token in [%User{}, %APIToken{}] do
change_update(
%Update{},
media,
Expand Down

0 comments on commit df7a9aa

Please sign in to comment.