Bob Sanders
2008-Oct-02 00:09 UTC
How do you validate the availability for a "block of time"?
I''m building an "appointment time" application, where the user selects an appointment time through a datetime_select field. I''m trying to validate that the appointment time the user selects is available. The appointment times are for 30 minutes each, so a user should not be able to create a new appointment time within 30 minutes of an existing appointment. Do you know how to validate that in the Appintment model? (e.g. def validates_available_appointment_time_slot ... end ) Any ideas? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jodi Showers
2008-Oct-02 00:33 UTC
Re: How do you validate the availability for a "block of time"?
Bob - On 1-Oct-08, at 8:09 PM, Bob Sanders wrote:> > I''m building an "appointment time" application, where the user selects > an appointment time through a datetime_select field. > > I''m trying to validate that the appointment time the user selects is > available. > > The appointment times are for 30 minutes each, so a user should not be > able to create a new appointment time within 30 minutes of an existing > appointment. > > Do you know how to validate that in the Appintment model? > > (e.g. > > def validates_available_appointment_time_slot > ... > end > > ) > > Any ideas?runt is great for managing date blocks http://runt.rubyforge.org/ J --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---