diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-29 12:28:12 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:24 -0700 |
commit | 4a744938167067978ce428c3e2b1efb0b4f05141 (patch) | |
tree | 362ba7dc4eeffc68040bf9713745428841b82be4 /activerecord/lib/active_record/railties/databases.rake | |
parent | 17a66a8ddc5a2ee8263d1dcc86a032322cb8e615 (diff) | |
download | rails-4a744938167067978ce428c3e2b1efb0b4f05141.tar.gz rails-4a744938167067978ce428c3e2b1efb0b4f05141.tar.bz2 rails-4a744938167067978ce428c3e2b1efb0b4f05141.zip |
default writing the schema file as utf-8
Diffstat (limited to 'activerecord/lib/active_record/railties/databases.rake')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 0ee7e20cf1..ec00f7faad 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -341,7 +341,8 @@ db_namespace = namespace :db do desc 'Create a db/schema.rb file that can be portably used against any DB supported by AR' task :dump => :load_config do require 'active_record/schema_dumper' - File.open(ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb", "w") do |file| + filename = ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb" + File.open(filename, "w:utf-8") do |file| ActiveRecord::Base.establish_connection(Rails.env) ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file) end |