diff options
author | kennyj <kennyj@gmail.com> | 2012-06-29 20:35:49 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-07-01 00:56:50 +0900 |
commit | bece59e36df9a267046bac377001b6ff610e8151 (patch) | |
tree | e821a073df33b9e9641ae44954b4cef80995d4d4 /activerecord/lib/active_record/railties | |
parent | 05c7e0ae6425fc5cbc9cb50bd035a3ee80e8b4b3 (diff) | |
download | rails-bece59e36df9a267046bac377001b6ff610e8151.tar.gz rails-bece59e36df9a267046bac377001b6ff610e8151.tar.bz2 rails-bece59e36df9a267046bac377001b6ff610e8151.zip |
Extract collation tasks to database tasks.
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 3e351bf0e2..52fa4fb8be 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -148,14 +148,9 @@ db_namespace = namespace :db do # desc "Retrieves the collation for the current environment's database" task :collation => [: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.collation - else - $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' - end + puts ActiveRecord::Tasks::DatabaseTasks.collation_current + ensure NoMethodError + $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' end desc 'Retrieves the current schema version number' |