In our product we have a model that has an optional state machine. The state_machine method returns nil for instances where no state_machine is appropriate / the state machine functionality is not relevant.
This method was causing an exception when the instance was reloaded. It's fixed with this safe navigation operator.
In our product we have a model that has an optional state machine. The
state_machine
method returns nil for instances where no state_machine is appropriate / the state machine functionality is not relevant.This method was causing an exception when the instance was reloaded. It's fixed with this safe navigation operator.