Skip to content

Instantly share code, notes, and snippets.

@rsl
Created August 20, 2013 15:23
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 rsl/6282912 to your computer and use it in GitHub Desktop.
Save rsl/6282912 to your computer and use it in GitHub Desktop.
conditional rescues. there has to be something better than this. this screams inefficient. but tbh it's not an issue that will really happen in production.
def create_database
Apartment::Database.create database_name
rescue Apartment::SchemaExists => err
raise err unless Rails.env.development?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment