Skip to content
This repository
Browse code

More `:rails_env` cleanup.

`Rails.env` already use development if ENV["RAILS_ENV"] is not present.
  • Loading branch information...
commit 469d8857988a88d404cec1e9b7a7896d6161324e 1 parent ebddf75
Rafael Mendonça França rafaelfranca authored spastorino committed

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. +6 6 activerecord/lib/active_record/railties/databases.rake
12 activerecord/lib/active_record/railties/databases.rake
@@ -200,7 +200,7 @@ db_namespace = namespace :db do
200 200 end
201 201
202 202 desc 'Display status of migrations'
203   - task :status => [:environment, :load_config, :rails_env] do
  203 + task :status => [:environment, :load_config] do
204 204 config = ActiveRecord::Base.configurations[Rails.env]
205 205 ActiveRecord::Base.establish_connection(config)
206 206 unless ActiveRecord::Base.connection.table_exists?(ActiveRecord::Migrator.schema_migrations_table_name)
@@ -253,7 +253,7 @@ db_namespace = namespace :db do
253 253 end
254 254
255 255 # desc "Retrieves the charset for the current environment's database"
256   - task :charset => [:environment, :load_config, :rails_env] do
  256 + task :charset => [:environment, :load_config] do
257 257 config = ActiveRecord::Base.configurations[Rails.env]
258 258 case config['adapter']
259 259 when /mysql/
@@ -271,7 +271,7 @@ db_namespace = namespace :db do
271 271 end
272 272
273 273 # desc "Retrieves the collation for the current environment's database"
274   - task :collation => [:environment, :load_config, :rails_env] do
  274 + task :collation => [:environment, :load_config] do
275 275 config = ActiveRecord::Base.configurations[Rails.env]
276 276 case config['adapter']
277 277 when /mysql/
@@ -311,7 +311,7 @@ db_namespace = namespace :db do
311 311
312 312 namespace :fixtures do
313 313 desc "Load fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures."
314   - task :load => [:environment, :load_config, :rails_env] do
  314 + task :load => [:environment, :load_config] do
315 315 require 'active_record/fixtures'
316 316
317 317 ActiveRecord::Base.establish_connection(Rails.env)
@@ -349,7 +349,7 @@ db_namespace = namespace :db do
349 349
350 350 namespace :schema do
351 351 desc 'Create a db/schema.rb file that can be portably used against any DB supported by AR'
352   - task :dump => [:environment, :load_config, :rails_env] do
  352 + task :dump => [:environment, :load_config] do
353 353 require 'active_record/schema_dumper'
354 354 filename = ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb"
355 355 File.open(filename, "w:utf-8") do |file|
@@ -376,7 +376,7 @@ db_namespace = namespace :db do
376 376
377 377 namespace :structure do
378 378 desc 'Dump the database structure to db/structure.sql. Specify another file with DB_STRUCTURE=db/my_structure.sql'
379   - task :dump => [:environment, :load_config, :rails_env] do
  379 + task :dump => [:environment, :load_config] do
380 380 abcs = ActiveRecord::Base.configurations
381 381 filename = ENV['DB_STRUCTURE'] || File.join(Rails.root, "db", "structure.sql")
382 382 case abcs[Rails.env]['adapter']

0 comments on commit 469d885

Please sign in to comment.
Something went wrong with that request. Please try again.