What you want is polymorphic joins. Look it up in google.

Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/

On 01/03/2009, at 1:06 AM, Joe Canares <rails-mailing-l...@andreas- 
s.net> wrote:

>
> Conrad Taylor wrote:
>> On Sat, Feb 28, 2009 at 5:51 AM, Joe Canares <
>> [email protected]> wrote:
>
>> Hi, in the original e-mail you said that you were receiving an error
>> message
>> in regards to
>> SQLite3.  OK, if you have classa and classb, you should have  
>> created the
>> following
>> databases:
>>
>> classas
>> classbs
>
>
> My database contains the tables classas, classcs and classcs, with
> classcs having the colums classa_id and classb_id. Saving an  
> instance of
> classa with its  classc works fine, but saving classb doesn't.
>
> I'm not sure if it is even possible to have two belongs_to- 
> relationship
> in a model, because that would imply that one of the foreign key  
> colums
> will be NULL after saving. That was actually my question in the first
> place, sorry if my example confused everybody =)
>
> JC
>
> -- 
> 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