diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-02 17:58:47 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-02 17:58:47 -0300 |
commit | e23b26cfda35f68e134ab76ce5a5d98f8bd7a797 (patch) | |
tree | dba561ff73c7191912dcab28d3c8e4922b7202da /activerecord/lib/active_record/railties | |
parent | 2f4b82f1d84799ca91ccfe314644bcde886851a0 (diff) | |
download | rails-e23b26cfda35f68e134ab76ce5a5d98f8bd7a797.tar.gz rails-e23b26cfda35f68e134ab76ce5a5d98f8bd7a797.tar.bz2 rails-e23b26cfda35f68e134ab76ce5a5d98f8bd7a797.zip |
More `:rails_env` cleanup.
`Rails.env` already use development if ENV["RAILS_ENV"] is not present.
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index ef8f577fc3..79032fe4df 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -200,7 +200,7 @@ db_namespace = namespace :db do end desc 'Display status of migrations' - task :status => [:environment, :load_config, :rails_env] do + task :status => [:environment, :load_config] do config = ActiveRecord::Base.configurations[Rails.env] ActiveRecord::Base.establish_connection(config) unless ActiveRecord::Base.connection.table_exists?(ActiveRecord::Migrator.schema_migrations_table_name) @@ -253,7 +253,7 @@ db_namespace = namespace :db do end # desc "Retrieves the charset for the current environment's database" - task :charset => [:environment, :load_config, :rails_env] do + task :charset => [:environment, :load_config] do config = ActiveRecord::Base.configurations[Rails.env] case config['adapter'] when /mysql/ @@ -271,7 +271,7 @@ db_namespace = namespace :db do end # desc "Retrieves the collation for the current environment's database" - task :collation => [:environment, :load_config, :rails_env] do + task :collation => [:environment, :load_config] do config = ActiveRecord::Base.configurations[Rails.env] case config['adapter'] when /mysql/ @@ -311,7 +311,7 @@ db_namespace = namespace :db do namespace :fixtures do 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." - task :load => [:environment, :load_config, :rails_env] do + task :load => [:environment, :load_config] do require 'active_record/fixtures' ActiveRecord::Base.establish_connection(Rails.env) @@ -349,7 +349,7 @@ db_namespace = namespace :db do namespace :schema do desc 'Create a db/schema.rb file that can be portably used against any DB supported by AR' - task :dump => [:environment, :load_config, :rails_env] do + task :dump => [:environment, :load_config] do require 'active_record/schema_dumper' filename = ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb" File.open(filename, "w:utf-8") do |file| @@ -376,7 +376,7 @@ db_namespace = namespace :db do namespace :structure do desc 'Dump the database structure to db/structure.sql. Specify another file with DB_STRUCTURE=db/my_structure.sql' - task :dump => [:environment, :load_config, :rails_env] do + task :dump => [:environment, :load_config] do abcs = ActiveRecord::Base.configurations filename = ENV['DB_STRUCTURE'] || File.join(Rails.root, "db", "structure.sql") case abcs[Rails.env]['adapter'] |