太陽黒点検索で「または」を使用するにはどうすればよいですか?
私のコードでは
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)
私の質問を理解していただければ幸いです。