Rails 3 has_one association: unlink associated object without destroying it?
问题 I have two classes, Master and Slave . The Master class has_one slave , the Slave class belongs to master . Given two associated objects, master_a and slave_a (where slave_a belongs to master_a ), how can I unlink them without destroying slave_a from the database? I essentially need to "free-up" slave_a . I've tried master_a.slave.delete , which destroys slave_a from the database. I've also tried master_a.slave.update_attribute(:master_id, nil) , but next time master_a.save is called, it