Hacker News new | ask | show | jobs
by Gasparila 2478 days ago
There's a .size that works for pretty much everything: if the relation isn't loaded then it will do select count(*), but for arrays and loaded associations it does length of an array