Peter Fitzgibbons
2006-May-24 21:36 UTC
[Rails] AR many-many join tables - can they have created_on, updated_on ?
Hello all, I''m creating a many-many join table between ''homes'' and ''users''. Can it contain created_on? will AR update created_on, updated_on on this table? CREATE homes_users ( home_id int not null, user_id int not null, created_on datetime null, updated_on datetime null ) Thanks for your advice! -- ------------------------------ Apple MacBook. Black. It''s the new White! ------------------------------ Peter Fitzgibbons -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060524/7c8c5a2e/attachment.html
njmacinnes@gmail.com
2006-May-24 23:11 UTC
[Rails] AR many-many join tables - can they have created_on, updated_on ?
I don''t think so. It''s the table''s associated class/object that does it and a habtm table doesn''t have a class. Use a has_many :through. That''ll do it. -N On 24/05/06, Peter Fitzgibbons <peter.fitzgibbons@gmail.com> wrote:> Hello all, > > I''m creating a many-many join table between ''homes'' and ''users''. Can it > contain created_on? will AR update created_on, updated_on on this table? > > CREATE homes_users ( > home_id int not null, > user_id int not null, > created_on datetime null, > updated_on datetime null > ) > > Thanks for your advice! > > -- > ------------------------------ > Apple MacBook. Black. It''s the new White! > ------------------------------ > Peter Fitzgibbons > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >