Well, I guess I''ll share that I think :through associations will
probably be my need, anybody concur or dissent?
Person
id
name
info
Event
id
name
info
Attendences
id
person_id
event_id
payment_id
Will it cause any trouble not calling it Event_person?
On Feb 14, 1:05 pm, kopf1988
<kopf1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Okay, we''ll I''ve been working on this crazy fun project
(lol, maybe
> fun when we''re done). We''re working on a registration
system for
> conventions [and sadly, not even getting paid :( ], so I want to
> ensure that we start off correctly before getting to far into
> something broken.
>
> We''ve got Models that are Attendees, Events, and Payments.
That''s the
> only simple part. After that, we have Attendees which are going to
> Events, and events that belong to bigger events! Some events have
> payments, some do not.
>
> So - I was thinking is the best way to do this be a HABTM type of
> thing. The inner table would reference something like
"Attendences"
> and have Attendee_id and Event_id.
>
> Or would it be better to do something polymorphic. Have events be
> attendable and payable. But then, I don''t think you have an
Attendee
> go to more than one event, right? Because I can''t picture how the
> database would have that setup.
>
> Or is there a more creative way that would mean to create a Model
> called "Attendences" to tie Events, Attendees, and Payments
> together... or would that not be necessary, because that''s
probably
> what HABTM.
>
> Imagine we have a Person like this:
>
> Person ("John")
> ---> Event ("Anime Convention")
> ----------> Payment ("John''s con payment")
> ----------> Event ("Art Show")
> -----------------> Payments ("John''s art show
payment")
>
> Any suggestions on the best way to implement this. Or maybe does
> anyone have a plugin or example? Any help would be greatly
> appreciated... we want to make some noise with this program, ^_^
>
> -Ryan
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---