Permalink
Browse files

Change to use String#delete to remove a substring rather than String#sub

  • Loading branch information...
1 parent 2bb098f commit ea16ef854285a64bb720a37c567a6bfc7cc25e0e @dkubb dkubb committed Apr 1, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 templates/rails/database.yml.rb
  2. +1 −1 templates/rails/gemfile.rb
@@ -1,7 +1,7 @@
# TODO think about a better way
db_name = app_path.split('/').last
-database = options[:database].sub(/jdbc/, '')
+database = options[:database].delete('jdbc')
database = 'postgres' if database == 'postgresql'
database = 'sqlite' if database == 'sqlite3'
@@ -3,7 +3,7 @@
DATAMAPPER = '#{DATAMAPPER}'
RSPEC = '#{RSPEC}'
-database = options[:database].sub(/jdbc/, '')
+database = options[:database].delete('jdbc')
database = 'postgres' if database == 'postgresql'
database = 'sqlite' if database == 'sqlite3'

0 comments on commit ea16ef8

Please sign in to comment.