Created
March 10, 2014 15:07
-
-
Save kennyp/9466742 to your computer and use it in GitHub Desktop.
Users without a role.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::User.joins('LEFT JOIN "spree_roles_users" ON "spree_roles_users"."user_id" = "spree_users"."id" LEFT JOIN "spree_roles" ON "spree_roles"."id" = "spree_roles_users"."role_id"').group('spree_users.id').having('count(spree_roles.id) = 0') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment