cords the user can access</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">Project</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.accessible_by(ability).to_sql </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># see what the generated SQL looks like to help determine why it&#39;s not fetching the records you want</span></span></code></pre></div><p>If you find it is fetching the wrong records in complex cases, you may need to use an S