diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/tasks/mysql_database_tasks.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb index 2340f949b7..7abbf08571 100644 --- a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb +++ b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb @@ -73,11 +73,14 @@ module ActiveRecord configuration.merge('database' => nil) end + # If neither encoding nor collation is specified, use the utf-8 defaults. def creation_options - { - charset: (configuration['encoding'] || DEFAULT_CHARSET), - collation: (configuration['collation'] || DEFAULT_COLLATION) - } + options = configuration.slice('encoding', 'collation').symbolize_keys + if options.empty? + { charset: DEFAULT_CHARSET, collation: DEFAULT_COLLATION } + else + options + end end def error_class |