我们在项目中使用了acts_as_paranoid gem(https://github.com/ActsAsParanoid/acts_as_paranoid)进行软删除。这个项目现在已经上线了。面对这个gem中的一些问题,并计划迁移到paranoia gem(https://github.com/rubysherpas/paranoia)。在迁移时有什么需要考虑的吗?
发布于 2019-03-19 04:55:02
我建议您看一下Discard
https://github.com/jhawthorn/discard#why-not-paranoia-or-acts_as_paranoid
它通过采用一种更简单的方法来提供隐藏软删除记录的方便方法,从而在不覆盖activerecord方法的情况下实现了类似的目标。在文档中有一节关于作者为什么认为这比作为偏执狂或偏执狂好。
https://stackoverflow.com/questions/55226574
复制相似问题