Skip to content

Instantly share code, notes, and snippets.

@apaciuk
Last active November 6, 2022 22:28
Show Gist options
  • Save apaciuk/a1c66c4bcc2bcdabb23613c1b24bb700 to your computer and use it in GitHub Desktop.
Save apaciuk/a1c66c4bcc2bcdabb23613c1b24bb700 to your computer and use it in GitHub Desktop.
arel_table active record
user_is_admin = AdminUser.arel_table
admin ||= AdminUser.all.where(user_is_admin[:email].eq(User.email).to_sql)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment