场景是有两个模型,一个是Room,另一个是Tickets,关系是Room has_many:ticket.
要求是当房间正在删除时不应删除票证.如何实现这一点,因为票证表有外键称为room_id?
并且假设我能够这样做,那么我将如何获得该特定票的房间信息?
ruby-on-rails associations has-many dependent-destroy
associations ×1
dependent-destroy ×1
has-many ×1
ruby-on-rails ×1