versastylist / mona

0 stars 0 forks source link

Stylist Add Service - Should not be able to create empty services with no product added #187

Closed captain-awesome closed 8 years ago

captain-awesome commented 9 years ago

stylist should not be able to create empty services with no product added

SpencerCDixon commented 9 years ago

sorry but there is validations on this already. It's not letting me create empty ones?

SpencerCDixon commented 9 years ago

@versastylist if this is still an issue feel free to re-open but not an issue for me, it throws all sorts of errors when you try to create invalid service products

captain-awesome commented 9 years ago

This issue still persists.

To reproduce:

  1. select "add service"
  2. choose hair cut for example
  3. do not select "add new product"
  4. select "create services"
  5. notification at the top states, "Successfully added services."

it's understood the service technically hasn't been added but this type of behavior should be prevent.

SpencerCDixon commented 8 years ago

there is no easy way to make a validation for this because you can't validate the presence of service products in order to create a service since a service needs to be created first before a service product is created. It's a chicken and the egg scenario... we could give up the service product validations in exchange for just validating that the user is trying to add at least 1 service product but that seems like a less than ideal solution because there would be no point in a user ever creating a service without a service product...

Feel free to create a form object that does all the validation you want but I imagine its going to be very difficult with using cocoon and nested attributes.