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.

Revisions

  1. apaciuk revised this gist Nov 6, 2022. No changes.
  2. apaciuk created this gist Nov 6, 2022.
    2 changes: 2 additions & 0 deletions arel_table active record
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    user_is_admin = AdminUser.arel_table
    admin ||= AdminUser.all.where(user_is_admin[:email].eq(User.email).to_sql)