Skip to content

Instantly share code, notes, and snippets.

@Heavyblade
Created May 30, 2012 20:17
Show Gist options
  • Save Heavyblade/2838666 to your computer and use it in GitHub Desktop.
Save Heavyblade/2838666 to your computer and use it in GitHub Desktop.
def ensure_admin
redirect_to '/wait_for_approval' and return unless current_user.approved?
redirect_to '/' unless current_user.admin?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment