democracyworks / hat-trick

Hat Trick - Rails wizards done right
MIT License
5 stars 0 forks source link

No fields on first step causes ActiveRecord::RecordNotUnique error #22

Open paulschreiber opened 12 years ago

paulschreiber commented 12 years ago

If you don't put any fields on the first step in the wizard, when you click next, the app will crash with a ActiveRecord::RecordNotUnique error.

This is because it's trying to save with an email address of '', which is not allowed.

If there are no fields, we shouldn't call create.

cap10morgan commented 12 years ago

Not a hat-trick bug. Hat-trick doesn't "call create" or any other controller methods. Rails does that.

I'm fixing this in the register_controller b/c it is caused by the unique requirements of our app. We can revisit adding some kind of support for "field-less first steps" in a hat-trick later on if this becomes a big problem.

paulschreiber commented 12 years ago

This seems like a good thing for hat-trick to be able to support.