I have the following two models and am not quite sure how they should be associated. - Car - CarWashStation At any given time, an instance of Car will be at (belong to?) one of a dozen car wash stations. What associations should I use (if any) between these models? Thanks in advance! Mark -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 4 April 2012 22:39, Mark 01 <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I have the following two models and am not quite sure how they should be > associated. > > - Car > - CarWashStation > > At any given time, an instance of Car will be at (belong to?) one of a > dozen car wash stations. What associations should I use (if any) between > these models?I would anticipate a CarWashing model, which has_one Car and one CarWashStation, along with details about the time of the washing, what soap was used, and which attendants conducted it (through an AttendantsCarWashings join table), etc. A Car would then have many CarWashings, and a named scope could give the current_car_washing. Or something like that. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I just realized CarWashStation might be misleading. Each station refers to one "activity location" that the car mush move through per wash. A few example instances might be: - Soap Application Station - Bristle Brush Station - Wax Station - Dry Station -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
The car exists independently of a CarWashStation. A CarWashStation can perform these [Enumerated] functions on a Class of Vehicle [such as a car]. Version 0. On 4 April 2012 17:39, Mark 01 <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I have the following two models and am not quite sure how they should be > associated. > > - Car > - CarWashStation > > At any given time, an instance of Car will be at (belong to?) one of a > dozen car wash stations. What associations should I use (if any) between > these models? > > Thanks in advance! > > Mark > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Charles A. Lopez charlesalopez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org What''s your vision for your organization? What''s your biggest challenge? Let''s talk. (IBM Partner) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 April 2012 01:54, Mark P. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I just realized CarWashStation might be misleading. Each station refers > to one "activity location" that the car mush move through per wash. A > few example instances might be: > > - Soap Application Station > - Bristle Brush Station > - Wax Station > - Dry StationThat sounds like a CarWashing should have a state-machine to manage transitions between stations (rather than stations being models of their own). You could have sub-types of CarWashing that would provide different combinations of states (for the simple Wash''n''Wax to the full-on hand-finished-chamois-wipe-down-with-under-body-jet-wash). -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
I''ll look into what a state machine is. Thanks for that. Each station currently has many to do items as well as a uptime status and employees operating in that station. Does it still make sense for stations to not be their own model? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.