Hi
On 19 aug, 19:19, "Sunny Beach"
<sunnybeach1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I have a scenario where there is list of things (a list of chores for
> example) that have two parts, task and description.
>
> On an ongoing basis we assign a group of chores to people. Each assigned
> chore can be tweaked -- the description could be changed to say
"don''t
> forget to do x."
>
I''m puzzled by this statement:> In this case there is not a has_and_belongs_to (or many_through)
> relationship between people and chores because we don''t want to
edit the
> main list of chores.
What does editing the main list of chores have to do with the
has_many :through relationship? As Fred says, the easiest way would be
to actually link the tables together with a join model (assignments)
so you can track which user has which chore. But I also think to read
in your question the requirement to assign a *group* of chores to each
user, with the groups being pre-defined, rather than individual
chores. In that case, I would add an attribute to chore, the name of
the group it belongs to (or make a separate model for that) and still
assign individual chores to each user (but in the assignment method
and views, make sure you can only assign them by group).
Your question is still a bit ambiguous to me, not sure I''m on the
right track.
Dirk.
> We do want to go back later and see who had what chore
> and what the specific instructions were.
>
> My current idea is:
>
> Chore_Set has_many Chores (Chore_Set_id in each Chore) These chores have no
> overlap per set and are relatively set.
>
> Chores_User is somehow populated by selecting a Chore_Set, giving a copy of
> the individual Chores. Chores_user has the User_Id.
>
> Chores_User fields can then be edited or changed without changing the
> original Chore or Chore_Set
>
> ---
>
> Is there some predefined way of doing this? Some tutorial--something I am
> missing--some advice?
>
> Thanks,
> Sunny
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---