db:schema:load db:schema:dump: establish_connection(Rails.env) -> establ... #6736

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+2 −2
Split
@@ -314,7 +314,7 @@ db_namespace = namespace :db do
task :load => :environment do
require 'active_record/fixtures'
- ActiveRecord::Base.establish_connection(Rails.env)
+ ActiveRecord::Base.establish_connection
base_dir = File.join [Rails.root, ENV['FIXTURES_PATH'] || %w{test fixtures}].flatten
fixtures_dir = File.join [base_dir, ENV['FIXTURES_DIR']].compact
@@ -353,7 +353,7 @@ db_namespace = namespace :db do
require 'active_record/schema_dumper'
filename = ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb"
File.open(filename, "w:utf-8") do |file|
- ActiveRecord::Base.establish_connection(Rails.env)
+ ActiveRecord::Base.establish_connection
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
end
db_namespace['schema:dump'].reenable