Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Heroku 上执行此操作的最佳方法是什么?通过控制台?我确实为所有从属表设置了'dependent::destroy'。
heroku run rails console > Model.destroy_all
Model 是要销毁的模型的名称
您可以使用:
Object.delete_all
您还可以将 :dependent 选项设置为 :delete_all。:delete_all 将发出一条 SQL 语句来删除所有子记录。因此,使用 :delete_all 可能会给您带来更好的性能。
has_many :childs, :dependent => :delete_all
I made and initialized my model with the "change:status" event like this
Box = Backbone.Model.extend({ initialize: fu