如何在太阳黑子搜索中使用“或”?
在我的代码中,我有
with(:location_id, current_user.location.path_ids || current_user.location.parent.descendant_ids)
搜索仅评估第一部分。
如果我把'current_user.location.path_ids'放在第一位(在||之前),我只会得到该搜索的结果。如果我把'current_user.location.parent.descendant_ids'放在第一位,我会从那个搜索中得到结果。我想要两者的结果。
我也试过
with(:location_id, current_user.location.path_ids || :location_id, current_user.location.parent.descendant_ids)
我希望你能理解我的问题。