Permalink
Browse files

default writing the schema file as utf-8

  • Loading branch information...
tenderlove committed Jul 29, 2011
1 parent 3d6e187 commit cea06a8e3f1f129ef330b346a38571a8a3309812
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 cea06a8

Please sign in to comment.