AASM callbacks are bypassed when updating model fields directly. This can be disabled by setting the no_direct_assignment flag, but this will break other integrations, such as a simple update via active_admin.
Is there a way to allow model updates to AASM state fields and make them behave as state transitions?
I.e. developer.update!(state: :hired) to behave the same as developer.hired!.
active_adminoffers a hacky solution to work with AASM.I came up with a model-agnostic way to turn direct state updates into transitions. This can be used in a regular controller as well, but here's an example working with
active_admin