aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/railties/databases.rake
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/railties/databases.rake')
-rw-r--r--activerecord/lib/active_record/railties/databases.rake15
1 files changed, 1 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake
index 539836e9ed..d513dca1f5 100644
--- a/activerecord/lib/active_record/railties/databases.rake
+++ b/activerecord/lib/active_record/railties/databases.rake
@@ -143,20 +143,7 @@ db_namespace = namespace :db do
# desc "Retrieves the charset for the current environment's database"
task :charset => [:environment, :load_config] do
- config = ActiveRecord::Base.configurations[Rails.env || 'development']
- case config['adapter']
- when /mysql/
- ActiveRecord::Base.establish_connection(config)
- puts ActiveRecord::Base.connection.charset
- when /postgresql/
- ActiveRecord::Base.establish_connection(config)
- puts ActiveRecord::Base.connection.encoding
- when /sqlite/
- ActiveRecord::Base.establish_connection(config)
- puts ActiveRecord::Base.connection.encoding
- else
- $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch'
- end
+ puts ActiveRecord::Tasks::DatabaseTasks.charset_current
end
# desc "Retrieves the collation for the current environment's database"