Skip to content

Instantly share code, notes, and snippets.

@lightningdb
Created May 25, 2010 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lightningdb/412829 to your computer and use it in GitHub Desktop.
Save lightningdb/412829 to your computer and use it in GitHub Desktop.
# instead of:
if retail_chains && retail_chains.size > 0
return retail_chains[0]
end
# you could write:
retail_chains.first unless retail_chains.blank?
# (or another way)
retail_chains.first if retail_chains.present?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment