SHARE
TWEET

Untitled

a guest May 31st, 2019 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Account.all.select("accounts.*, Count(accounts.id) members_count").joins("LEFT JOIN users_accounts ON accounts.id = users_accounts.account_id").group("accounts.id").order("members_count DESC")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top