我有一个Meeting
模型,其中包含存档数据和非存档数据。
当我运行时,Model.reindex
只有非归档数据被索引。
我也想索引非归档数据,以便在使用search
searchkick 方法时也能看到非归档数据。
对于存档,我使用了paranoia
gem,存档的列名为cancelled_at
.
我有一个Meeting
模型,其中包含存档数据和非存档数据。
当我运行时,Model.reindex
只有非归档数据被索引。
我也想索引非归档数据,以便在使用search
searchkick 方法时也能看到非归档数据。
对于存档,我使用了paranoia
gem,存档的列名为cancelled_at
.
Model.with_deleted.reindex
由于偏执狂 gem default_scope 始终没有删除/存档的,因此只需使用偏执狂自述文件https://github.com/rubysherpas/paranoia#usage中记录的辅助范围