Forum: Ruby on Rails AR many-many join tables - can they have created_on, updated

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3203ed0e608d3bfae1e31282e629ffa2?d=identicon&s=25 Peter Fitzgibbons (Guest)
on 2006-05-24 23:38
(Received via mailing list)
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!
D5145c421cd25af6fa577c15219add90?d=identicon&s=25 unknown (Guest)
on 2006-05-25 01:13
(Received via mailing list)
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
This topic is locked and can not be replied to.