Rails HABTM 中 join table 时间戳的更新问题

edisonhsu · November 10, 2014 · Last by edisonhsu replied at November 10, 2014 · 1344 hits

我有一个 join table 已经把时间戳加上去了,但是我增加关系的时候,时间戳不更新。 想问问用什么办法能更新 rails 版本是 3.2

据说所知,has_and_belongs_to_many 的中间表只操作两个外键字段,是不操作主键、时间戳之类字段的。得用一个模型来代表中间才行。

2 Floor has deleted

#1 楼 @cisolarix 哦~这个做法在 stackoverflow 上看到过。一开始觉得麻烦。现在去试试看。

You need to Sign in before reply, if you don't have an account, please Sign up first.