i''m trying to migrate a system written in php to rails. it has basically 3 tables: A, B and C, with their respective attributes. it also has a table D which only has a_id, b_id and c_id in order to relate them. is it possible to keep the same structure using has_and_belongs_to_many? thanks, pietro. -- "Educators, generals, dieticians, psychologists, and parents program. Armies, students, and some societies are programmed." --Harold Abelson and Gerald Jay Sussman with Julie Sussman, "Structure and Interpretation of Computer Programs"
On 15.6.2005, at 20:18, pietro wrote:> i''m trying to migrate a system written in php to rails. it has > basically 3 > tables: A, B and C, with their respective attributes. it also has a > table > D which only has a_id, b_id and c_id in order to relate them. is it > possible to keep the same structure using has_and_belongs_to_many?No but it''s possible to do it using d belongs_to :a, belongs_to :b etc. //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 6/16/05, Jarkko Laine <jarkko-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org> wrote:> > On 15.6.2005, at 20:18, pietro wrote: > > > i''m trying to migrate a system written in php to rails. it has > > basically 3 > > tables: A, B and C, with their respective attributes. it also has a > > table > > D which only has a_id, b_id and c_id in order to relate them. is it > > possible to keep the same structure using has_and_belongs_to_many? > > No but it''s possible to do it using d belongs_to :a, belongs_to :b etc.Assuming that D has an id.> //jarkko > > -- > Jarkko Laine > http://jlaine.net > http://odesign.fi > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > >-- Cheers Koz