New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
State of new object with ActiveRecord #191
Comments
I encountered this problem today as well. I find that it's best to not check directly against the database column to retrieve the current state. The recommended approach is: @product_sale_import.aasm.current_state Once persisted, the |
Will release a patch soon (will be |
Work fine with master and rails 4.2.0.rc1 |
I just released version |
I'm on version user = User.new
user.aasm.current_state # :pending
user.save # true
user.aasm.current_state # nil |
I'm at version aasm column: :state, create_scopes: false do
state :draft, initial: true
state :bank_info
state :complete
event :next_step do
transitions from: :draft, to: :bank_info
transitions from: :bank_info, to: :complete
end
end Also my object don`t transition to next state: project = Project.new
project.state # :nil
project.aasm.current_state # :draft
project.next_step #true
project.state # :nil
project.aasm.current_state # :draft .. should be :bank_info |
Never mind what i said, there was one module overwriting the state method. |
Hi,
I don't know if it's a bug or a bad comprehension of process
With this code:
The state should be 'picking' ?
The text was updated successfully, but these errors were encountered: