State Transitions Return true but do Nothing
-
Gaius Centus Novus
An oddity: after a state transition,
read_attributereturns the correct value even thoughstatedoesn't:i = Item.create! i.check_out! i.state # => 'available' i.read_attribute(i.class.aasm_column) # => 'in_use' -
Gaius Centus Novus
The problem was that I was using
alias_attributeinstead ofaasm_column:# wrong class Item include AASM alias_attribute :aasm_state, :state end # right class Item include AASM self.aasm_column :state endAASM wrote to "
:aasm_state," which I assumed would write through, but didn't.This ticket can be closed.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.