On Sun, May 25, 2008 at 8:55 AM, Fountain
<vpotus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> I''m new to programming but wanted to try my hand at implementing a
> ''Team'' model for my site and wanted to see how others
would approach
> it.
>
> Right now I am creating a ''Team'' model that would be
owned by a Team
> Captain (i.e. a person) and would be comprised of a Team Captain and
> other people.
>
> ''Team'' has it''s own model and controller and a
simple collection of
> specs (i.e. name, description, points).
>
> Where I start to get confused is how I should implement the
''roster''.
> At this point, my thinking is to create a
''team_connection'' model that
> associates the team with a person_id.
>
> Is this a sound approach or should I create some ''roster''
model that
> the Team owns and allow Team Captains to admin the roster contents?
>
> I hope this is clear. How would you do it?
>
A few questions...
* Do people belong to more than one team?
If no, then you can just do something like:
Team has_many players
Player belongs_to Team
For the team captain, you could add an attribute on Player (person)
that''s a boolean for is_captain? or something. Another option would be
to add a foreign_key on Team for captain_id and that''d link to a
Player.
Good luck,
Robby
--
Robby Russell
Founder and Executive Director
PLANET ARGON, LLC
Design, Development, and Hosting with Ruby on Rails
http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---