Closed smilyalexey closed 1 year ago
You found the proper flow to rename it. You need to:
upcast do |hash|
hash['end_at'] = hash['finish_at'] if hash['finish_at'].present?
end
This is indeed the proper way. Thanks for reporting this.
Also there is mentioning that it's possible to update EventRecord directly.
I actually don't think this is a good advice and will remove it from the docs.
ok it's clear now. thanks 👍
Hello @lvonk. Can you explain me the process of renaming fields in command, event and aggregate.
Let's imagine I have
SearchSubmitted
event:SubmitSearch
command:And finally there is aggregate
Search
:Now I found that
end_at
is better thanfinish_at
. What's a proper flow to rename it? In documentation I found upcasting, but it looks as if it's only for event. Also there is mentioning that it's possible to update EventRecord directly. What about commands and aggregate? How should I update them?And regarding upcasting - should it be like in docs:
or we also need to check if there is no
hash['end_at']
? Something like this: