Default values in join_table columns

gary burns
Mon, 21 Feb 2005 23:10:22 -0000

Hello,

New to ruby/rails, spending the holiday messing
around with it -- fun so far, but there''s one things I''ve hit
that''s had me wondering...

I have a many->many relationship, between members
& groups -- I define my join table and see the rows being
automatically created just fine when manipulating the
model objects.

The trouble is, each of these tables has a column named
''ctime'', which is set automatically by the DB ( MySQL )
to the current timestamp when the row is created. And
what''s happening, is that time a new row is inserted
into the join table, the ''ctime'' from the group or user is
copied into the insert statement.

It seems like if there''s any shared column names
between the join table and the primary table, the join
table will end up with a copy of the primaries values.

Is there a way to turn this behavior off?  Without having
to go and provide a full replacement for the update &
insert SQL?

Thanks, any pointers much appreciated.
Gary