Permalink
Browse files

default writing the schema file as utf-8

  • Loading branch information...
1 parent 17a66a8 commit 4a744938167067978ce428c3e2b1efb0b4f05141 @tenderlove tenderlove committed with fxn Jul 29, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 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

0 comments on commit 4a74493

Please sign in to comment.