Permalink
Browse files

default writing the schema file as utf-8

  • Loading branch information...
1 parent 5d7ed7a commit 3676af404d3c8ae869119f0ca093e0879a67c585 @tenderlove tenderlove committed Jul 29, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 activerecord/lib/active_record/railties/databases.rake
View
3 activerecord/lib/active_record/railties/databases.rake
@@ -332,7 +332,8 @@ namespace :db do
desc "Create a db/schema.rb file that can be portably used against any DB supported by AR"
task :dump => :environment 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 3676af4

Please sign in to comment.