code_interface, compile time vs runtime
if this were a code_interface, is timestamp captured once at compile time and all future calls use that compiled timestamp value? If yes, is there a different way to solve this? I've got multiple live views calls this code_interface and I'm wanting to keep all the logic in one place
7 Replies
timestamps would be captured at compile time
The only way to solve it would be to make it also accept a function.
Solution
i.e
default_options: fn -> ... end
compile time, got it. I was seeing weird behavior with balances and suspected that might be it. Thank you!
This would likely be a very easy PR to make if you're interested 😄
with that said, if that is coming from
ash_double_entry
I think it defaults to now inside the calculation?i left off
timestamp: DateTime.utc_now()
and saw the same behavior.hmm... oh
yeah
thats a weird one
because it sets the defaults when you load
but yeah making that accept a function would be good.