adild99
2007-Aug-08 05:53 UTC
how do i validate if a datetime entered in the form has already been booked in another record?
I am creating a form to capture appointments for specialists and members... the schema of the appointments table looks something like this... id (integer) specialist_id (integer) member_id (integer) description (string) start_at (datetime) duration (integer) what i want to achieve is when trying to save a new appointment the data should be validated to check if an appointment is already booked for the specific specialist or member. in other words it should not allow me to book duplicate appointments for a specialist or member. any help would be highly appreciated. thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pawel Stawicki
2007-Aug-08 07:07 UTC
Re: how do i validate if a datetime entered in the form has
Maybe you should do it in model, in save or initialize method. Regards Paweł Stawicki -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---