Skip to content
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 methods not reflecting the current state #66

Closed
davidescobar opened this issue May 14, 2013 · 5 comments
Closed

State methods not reflecting the current state #66

davidescobar opened this issue May 14, 2013 · 5 comments
Assignees

Comments

@davidescobar
Copy link

Hello. In AASM 3.0.16, the following code works like this:

my_object.state # => "not_posted"
my_object.state = "completed"
my_object.state # => "completed"
my_object.completed? # => true

In version 3.0.17, it no longer works. In the last line, the "completed?" method now returns "false" - still thinks it's in the "not_posted" state, even though calling the "state" attribute directly shows the correct value. I've also tried persisting the state to the database with the same result, i.e. reloading the object with "my_object.reload" still does not work with the "completed?" method.

If I'm in the Rails console, exiting the console and re-entering it is the only way to obtain the updated state when calling the method.

@ghost ghost assigned alto May 14, 2013
@alto
Copy link
Member

alto commented May 14, 2013

Is my_object a persisted object (ActiveRecord or Mongoid)?

@davidescobar
Copy link
Author

It's an ActiveRecord persisted object.

@alto
Copy link
Member

alto commented May 15, 2013

Indeed, I can confirm the error. Will fix it asap.

@davidescobar
Copy link
Author

Awesome, thanks!

alto added a commit that referenced this issue May 15, 2013
@alto
Copy link
Member

alto commented May 15, 2013

Released version 3.0.18 to fix the problem.

@alto alto closed this as completed May 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants