Skip to content

Commit

Permalink
Rename supersede by superseded_by
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Jul 24, 2024
1 parent 115922b commit ffefb14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ defmodule Trento.DeregistrationProcessManager do
Legacy DeregistrationProcessManager module
"""

def supersede,
def superseded_by,
do: Trento.Infrastructure.Commanded.ProcessManagers.DeregistrationProcessManager
end
6 changes: 3 additions & 3 deletions lib/trento/support/jsonb_serializer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule Trento.Support.JsonbSerializer do
the event is wrapped in an `IntermediateEvent` struct.
The upcaster protocol is implemented for `IntermediateEvent` and it will take care of calling the `new!/1` function
after the upcasting is done.
If a process manager supports superseding because it was renamed (i.e. it has a `supersede/0` function),
If a process manager supports superseding because it was renamed (i.e. it has a `superseded_by/0` function),
the snapshotted process manager is superseded by the new module.
"""
def deserialize(term, config) do
Expand All @@ -41,8 +41,8 @@ defmodule Trento.Support.JsonbSerializer do
Kernel.function_exported?(module, :upcast, 2) ->
%IntermediateEvent{module: module, term: term}

Kernel.function_exported?(module, :supersede, 0) ->
module.supersede().new!(term)
Kernel.function_exported?(module, :superseded_by, 0) ->
module.superseded_by().new!(term)

true ->
module.new!(term)
Expand Down

0 comments on commit ffefb14

Please sign in to comment.