Skip to content

Instantly share code, notes, and snippets.

@jackdempsey
Created March 10, 2010 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jackdempsey/327546 to your computer and use it in GitHub Desktop.
Save jackdempsey/327546 to your computer and use it in GitHub Desktop.
# best way to code: if event is nil, true, otherwise if event.user == user true, else false
# seems clear but is so vertically long for such a simple thing
if event
event.user == user
else
true
end
# nice and compact but wtf does it mean
event.nil? || event.user == user
# winner winner?
(event && event.user == user) || true
# other thoughts? fork away
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment