aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorChristof Koenig <koenig@crealytics.de>2018-01-05 16:14:25 +0100
committerChristof Koenig <koenig@crealytics.de>2018-01-09 09:13:52 +0100
commitc33f47df672ae0bdc52a87abef4257cdcfbaf0f8 (patch)
tree6d3b0072f40861afa9dd1cae13333633bd4025fc /railties
parent5a5014688873f1d6e1b66075eea8a4356b5a4d07 (diff)
downloadrails-c33f47df672ae0bdc52a87abef4257cdcfbaf0f8.tar.gz
rails-c33f47df672ae0bdc52a87abef4257cdcfbaf0f8.tar.bz2
rails-c33f47df672ae0bdc52a87abef4257cdcfbaf0f8.zip
Work on a dup'ed options hash
Otherwise, at least using JRuby, the replacements in convert_database_option_for_jruby won't work. Thus a call to bundle exec rails app:update fails. Simply replacing those replace statements doesn't seem to work either, since the options hash seems to be frozen, too.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/app_base.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 400f954dcd..350b8ce093 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -315,11 +315,13 @@ module Rails
def convert_database_option_for_jruby
if defined?(JRUBY_VERSION)
- case options[:database]
- when "postgresql" then options[:database].replace "jdbcpostgresql"
- when "mysql" then options[:database].replace "jdbcmysql"
- when "sqlite3" then options[:database].replace "jdbcsqlite3"
+ opt = options.dup
+ case opt[:database]
+ when "postgresql" then opt[:database] = "jdbcpostgresql"
+ when "mysql" then opt[:database] = "jdbcmysql"
+ when "sqlite3" then opt[:database] = "jdbcsqlite3"
end
+ self.options = opt.freeze
end
end