Adrien Nom wrote:
> I want to do that way because i must save the possible mandates in one
> table. 

That's not a good rationale.  The place_id is part of the mandate just 
as much as the olace_type is, so it belongs in the mandates table.

> Then i use an other table to save the relation between mandates
> and users.
> How can i do that with an other way ?

If I understand you correctly, this will be very easy with your current 
schema, once you make the change I am proposing.

Basically, place_id is a property of the mandate, so it belongs in the 
mandates table.  Since you have mandate_id in elected, you can get the 
place_id with something like @elected.mandate.place_id.

> thanks for your answer
> adrien

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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 [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