0
我有4款車型,讓我們說,他們設置與此類似:刪除Ruby on Rails中的所有關聯
first model:
has_many :this
second model:
belongs_to first_model
has_many :these
third_model:
belongs_to second_model
has_many :more_of_these
fourth_model:
belongs_to third_model
我會把它想,如果有人刪除一些屬於第二模型,其中,那麼它從第三個和第四個刪除它的所有關聯。與第一個模型相同(刪除與模型2,3和4關聯的所有內容)等。
有人能指引我朝着正確的方向嗎?
史詩。謝謝你,先生! – LewlSauce 2014-10-19 18:25:58
永遠是一種享受! – rorofromfrance 2014-10-20 05:37:56