aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG6
-rw-r--r--railties/lib/tasks/databases.rake20
2 files changed, 16 insertions, 10 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 9d58def4be..b2d1fcd2b0 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,11 @@
*SVN*
+* Allow db:fixtures:load to load a subset of the applications fixtures. [Chad Fowler]
+
+ ex.
+
+ rake db:fixtures:load FIXTURES=customers,plans
+
* Update to Prototype 1.5.0_pre1 [Sam Stephenson]
* Update to script.aculo.us 1.6 [Thomas Fuchs]
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index 964613e8c1..e4da9aff78 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -5,16 +5,16 @@ namespace :db do
Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
end
- namespace :fixtures do
- desc "Load fixtures into the current environment's database"
- task :load => :environment do
- require 'active_record/fixtures'
- ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
- Dir.glob(File.join(RAILS_ROOT, 'test', 'fixtures', '*.{yml,csv}')).each do |fixture_file|
- Fixtures.create_fixtures('test/fixtures', File.basename(fixture_file, '.*'))
- end
- end
- end
+ namespace :fixtures do
+ desc "Load fixtures into the current environment's database. Load a single fixture using FIXTURE=x"
+ task :load => :environment do
+ require 'active_record/fixtures'
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'test', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
+ Fixtures.create_fixtures('test/fixtures', File.basename(fixture_file, '.*'))
+ end
+ end
+ end
namespace :schema do
desc "Create a db/schema.rb file that can be portably used against any DB supported by AR"