aboutsummaryrefslogtreecommitdiffstats
path: root/railties/fresh_rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'railties/fresh_rakefile')
-rwxr-xr-xrailties/fresh_rakefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/fresh_rakefile b/railties/fresh_rakefile
index 5407e140f1..8e88a4e85f 100755
--- a/railties/fresh_rakefile
+++ b/railties/fresh_rakefile
@@ -199,4 +199,13 @@ end
desc "Migrate the database according to the migrate scripts in db/migrate (only supported on PG/MySQL). A specific version can be targetted with VERSION=x"
task :migrate => :environment do
ActiveRecord::Migrator.migrate(File.dirname(__FILE__) + '/db/migrate/', ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
-end \ No newline at end of file
+end
+
+desc "Load fixtures into the current environment's database"
+task :load_fixtures => :environment do
+ require 'active_record/fixtures'
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
+ Dir.glob(File.join(RAILS_ROOT, 'test', 'fixtures', '*.yml')).each do |fixture_file|
+ Fixtures.create_fixtures('test/fixtures', File.basename(fixture_file, '.*'))
+ end
+end