diff options
author | Jeffrey Hardy <jeff@37signals.com> | 2010-01-06 13:58:27 -0500 |
---|---|---|
committer | Jeffrey Hardy <jeff@37signals.com> | 2010-01-06 13:58:27 -0500 |
commit | caad6c634c51714fa83419dfd3bf98fd32ff55cb (patch) | |
tree | 0ba6dc36127e2d794f454559a4236fb7ad3782d5 /activerecord/lib | |
parent | 894ce1553498fce6463f38cd0e41c2efbac31c0d (diff) | |
download | rails-caad6c634c51714fa83419dfd3bf98fd32ff55cb.tar.gz rails-caad6c634c51714fa83419dfd3bf98fd32ff55cb.tar.bz2 rails-caad6c634c51714fa83419dfd3bf98fd32ff55cb.zip |
Restore require of 'active_record/fixtures' for Rake tasks that use them
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 1ebb92e0f6..03359221c3 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -245,6 +245,8 @@ 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 do + require 'active_record/fixtures' + ActiveRecord::Base.establish_connection(Rails.env) base_dir = ENV['FIXTURES_PATH'] ? File.join(Rails.root, ENV['FIXTURES_PATH']) : File.join(Rails.root, 'test', 'fixtures') fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir @@ -256,6 +258,8 @@ namespace :db do desc "Search for a fixture given a LABEL or ID. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures." task :identify => :environment do + require 'active_record/fixtures' + label, id = ENV["LABEL"], ENV["ID"] raise "LABEL or ID required" if label.blank? && id.blank? |