Permalink
Browse files

Use configuration['encoding'], because database configuration use not…

… charset but encoding.
  • Loading branch information...
1 parent ccc6910 commit df9e135281463f11756ba7bf8f399523dfc1ee3c @kennyj kennyj committed Sep 11, 2012
@@ -27,7 +27,7 @@ def create
rescue error_class => error
$stderr.puts error.error
$stderr.puts "Couldn't create database for #{configuration.inspect}, #{creation_options.inspect}"
- $stderr.puts "(If you set the charset manually, make sure you have a matching collation)" if configuration['charset']
+ $stderr.puts "(If you set the charset manually, make sure you have a matching collation)" if configuration['encoding']
end
def drop
@@ -75,7 +75,7 @@ def configuration_without_database
def creation_options
{
- charset: (configuration['charset'] || DEFAULT_CHARSET),
+ charset: (configuration['encoding'] || DEFAULT_CHARSET),
collation: (configuration['collation'] || DEFAULT_COLLATION)
}
end
@@ -116,7 +116,7 @@ def prepare_command_options(command)
args = [command]
args.concat(['--user', configuration['username']]) if configuration['username']
args << "--password=#{configuration['password']}" if configuration['password']
- args.concat(['--default-character-set', configuration['charset']]) if configuration['charset']
+ args.concat(['--default-character-set', configuration['encoding']]) if configuration['encoding']
configuration.slice('host', 'port', 'socket').each do |k, v|
args.concat([ "--#{k}", v ]) if v
end
@@ -32,7 +32,7 @@ def test_creates_database_with_given_options
with('my-app-db', {:charset => 'latin', :collation => 'latin_ci'})
ActiveRecord::Tasks::DatabaseTasks.create @configuration.merge(
- 'charset' => 'latin', 'collation' => 'latin_ci'
+ 'encoding' => 'latin', 'collation' => 'latin_ci'
)
end
@@ -176,7 +176,7 @@ def test_recreates_database_with_the_given_options
with('test-db', {:charset => 'latin', :collation => 'latin_ci'})
ActiveRecord::Tasks::DatabaseTasks.purge @configuration.merge(
- 'charset' => 'latin', 'collation' => 'latin_ci'
+ 'encoding' => 'latin', 'collation' => 'latin_ci'
)
end
end

0 comments on commit df9e135

Please sign in to comment.