Permalink
Browse files

Backported #7572 to 3-2-stable. Use config['encoding'], because datab…

…ase configuration use not charset but encoding.
  • Loading branch information...
1 parent 924ad60 commit 96304855e6057944d8f5913e541f39c23e20088e @kennyj kennyj committed Sep 11, 2012
Showing with 9 additions and 3 deletions.
  1. +6 −0 activerecord/CHANGELOG.md
  2. +3 −3 activerecord/lib/active_record/railties/databases.rake
View
6 activerecord/CHANGELOG.md
@@ -1,4 +1,10 @@
## Rails 3.2.9 (unreleased)
+* Use config['encoding'] instead of config['charset'] when executing
+ databases.rake in the mysql/mysql2. A correct option for a database.yml
+ is 'encoding'.
+
+ *kennyj*
+
* Fix ConnectionAdapters::Column.type_cast_code integer conversion,
to always convert values to integer calling #to_i. Fixes #7509.
View
6 activerecord/lib/active_record/railties/databases.rake
@@ -44,7 +44,7 @@ db_namespace = namespace :db do
def mysql_creation_options(config)
@charset = ENV['CHARSET'] || 'utf8'
@collation = ENV['COLLATION'] || 'utf8_unicode_ci'
- {:charset => (config['charset'] || @charset), :collation => (config['collation'] || @collation)}
+ {:charset => (config['encoding'] || @charset), :collation => (config['collation'] || @collation)}
end
def create_database(config)
@@ -96,8 +96,8 @@ db_namespace = namespace :db do
ActiveRecord::Base.establish_connection(config)
else
$stderr.puts sqlerr.error
- $stderr.puts "Couldn't create database for #{config.inspect}, charset: #{config['charset'] || @charset}, collation: #{config['collation'] || @collation}"
- $stderr.puts "(if you set the charset manually, make sure you have a matching collation)" if config['charset']
+ $stderr.puts "Couldn't create database for #{config.inspect}, charset: #{config['encoding'] || @charset}, collation: #{config['collation'] || @collation}"
+ $stderr.puts "(if you set the charset manually, make sure you have a matching collation)" if config['encoding']
end
end
when /postgresql/

0 comments on commit 9630485

Please sign in to comment.