Skip to content

Instantly share code, notes, and snippets.

@phawk
Created May 20, 2012 20:59
Show Gist options
  • Select an option

  • Save phawk/2759513 to your computer and use it in GitHub Desktop.

Select an option

Save phawk/2759513 to your computer and use it in GitHub Desktop.
conditions better.
def some_method
if !@user.isLoggedIn?
goToLoginScreen
end
if !@user.isAdmin?
throwSomeUnathorisedError
end
#continue writing your code
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment