Or always copy it to Booking, and automatically update it for future Bookings if the Guest changes, as long as it matches the old one -- if that suits the situation.
On Thu, Jul 22, 2010 at 11:19, Jared Fraser <[email protected]> wrote: > If you had a attribute on your Stay or Booking or whatever for the phone > number, you could selectively add that where required and keep a more global > guest phone number on your guest model. So you use the booking phone number > where available and the guest phone number all other times. Perhaps. > > On Thu, Jul 22, 2010 at 11:16 AM, Simon Russell <[email protected]> > wrote: >> >> You're trying to reflect different instances of the Guest staying at >> the hotel (I'm assuming the situation is something like that), and you >> don't want to update information about the old stays when they stay >> again? I assume Guests aren't shared between hotels? >> >> Why not have a "Stay" model (_really_ bad name) which represents the >> actual stay at the place? Actually, why isn't the phone number just >> on the booking? >> >> On Thu, Jul 22, 2010 at 11:00, Harvey <[email protected]> wrote: >> > I have a situation in an application I'm working on where I have a >> > Booking model and a Guest model. >> > >> > At first I associated the models so that a Booking belongs_to :guest >> > and Guest has_many :bookings. This worked fine until I wanted to >> > update a guest phone number for a single booking an not have it affect >> > the other bookings for that customer. >> > >> > It seems what I need to do is make a duplicate of the Guest model for >> > each booking so I can then update the values on the per booking bases >> > but it was starting to get rather messy to maintain all the different >> > copies of the guest model. >> > >> > Does anyone know of way to handle this situation nicely? >> > >> > Scott >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Ruby or Rails Oceania" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group at >> > http://groups.google.com/group/rails-oceania?hl=en. >> > >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby or Rails Oceania" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/rails-oceania?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or Rails Oceania" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rails-oceania?hl=en. > -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.
