I want to do that way because i must save the possible mandates in one
table. Then i use an other table to save the relation between mandates
and users.
How can i do that with an other way ?
thanks for your answer
adrien

On Jun 28, 4:22 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-
s.net> wrote:
> Adrien Nom wrote:
> > Hi,
>
> > I need to do a polymorphic association but i want to save the field
> > XXX_type in an other table, like that :
>
> [...]
>
> > Table: ELECTED
> > - id
> > - user_id
> > - mandate_id
> > - place_id -> id of CITY.id or STATES.id  depending on
> > MANDATES.place_type related by mandate_id
>
> > How can I do that with rails ??
>
> Why do you want to do it that way?  It seems like extra work for no good
> reason.  Worse, it's poor DB design.  Since place_id and place_type are
> so intimately related, they belong in the same table.  In this case that
> probably means that place_id should go in mandates.
>
> [...]
>
> > Adrien
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> [email protected]
> --
> Posted viahttp://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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to