Skip to content

Commit caad6c6

Browse files
committed
Restore require of 'active_record/fixtures' for Rake tasks that use them
1 parent 894ce15 commit caad6c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

activerecord/lib/active_record/railties/databases.rake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ namespace :db do
245245
namespace :fixtures do
246246
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."
247247
task :load => :environment do
248+
require 'active_record/fixtures'
249+
248250
ActiveRecord::Base.establish_connection(Rails.env)
249251
base_dir = ENV['FIXTURES_PATH'] ? File.join(Rails.root, ENV['FIXTURES_PATH']) : File.join(Rails.root, 'test', 'fixtures')
250252
fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir
@@ -256,6 +258,8 @@ namespace :db do
256258

257259
desc "Search for a fixture given a LABEL or ID. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures."
258260
task :identify => :environment do
261+
require 'active_record/fixtures'
262+
259263
label, id = ENV["LABEL"], ENV["ID"]
260264
raise "LABEL or ID required" if label.blank? && id.blank?
261265

0 commit comments

Comments
 (0)