Skip to content

Instantly share code, notes, and snippets.

@TheDahv
Created August 29, 2013 22:13
Show Gist options
  • Save TheDahv/6384061 to your computer and use it in GitHub Desktop.
Save TheDahv/6384061 to your computer and use it in GitHub Desktop.
if ENV['RACK_ENV'] == 'development'
# Connect to development db
elsif ENV['RACK_ENV'] == 'test'
# Connect to test db
else
# Last case. Connect to production
end
## Example using case statement
switch ENV['RACK_ENV']
when 'development'
# Connect to development
when 'test'
# Connect to test
else
# Connect to production
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment