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

CheckoutController update_registration hack breaks validation if 'address' step is out of flow #31

Closed
youroff opened this issue Nov 7, 2012 · 5 comments

Comments

@youroff
Copy link

youroff commented Nov 7, 2012

I don't use 'address' step in my application and I get region validation error (related to Address I guess) trying to checkout as guest.

Why not to take first of the checkout_steps?

current_order.state = current_order.checkout_steps.first

@radar
Copy link
Contributor

radar commented Nov 7, 2012

Please provide steps to reproduce this issue. I don't understand your short description of the problem.

@youroff
Copy link
Author

youroff commented Nov 8, 2012

Well... there is only one step in my case. To remove 'address' step from the flow. When I manually set state to 'address' and try to update_attributes({email: 'some@example.com'}) for checking out as a guest, I always get validation error: @messages={:state=>["is invalid", "is invalid"]}

It seems like validation of state happens inside of state_machine, that's why I propose to use one of the actualy existing steps of checkout flow.

@ericboehs
Copy link
Contributor

Just saw this. I've attempted to fix this is PR59. Let me know if it works for you.

Edit: funny you used the exact same fix/syntax I did (and I hadn't seen this until after I PRed)! haha

@youroff
Copy link
Author

youroff commented Mar 14, 2013

That's exactly how I fixed it locally. :)

@radar
Copy link
Contributor

radar commented Mar 24, 2013

Sorry @youroff. This has been fixed by #59.

@radar radar closed this as completed Mar 24, 2013
damianlegawiec added a commit that referenced this issue Dec 19, 2019
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

3 participants