diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-05-11 19:08:13 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-05-11 19:08:13 +0200 |
commit | 4932f7b38f72104819022abca0c952ba6f9888cb (patch) | |
tree | b8f5d82f7a00d910e6e88648cfe3cda345cd0295 /railties/lib/rails_generator/generators/applications | |
parent | 2e7409f035236c719c5b1567c4bb3e65a5e543bc (diff) | |
download | rails-4932f7b38f72104819022abca0c952ba6f9888cb.tar.gz rails-4932f7b38f72104819022abca0c952ba6f9888cb.tar.bz2 rails-4932f7b38f72104819022abca0c952ba6f9888cb.zip |
Added db/seeds.rb as a default file for storing seed data for the database. Can be loaded with rake db:seed (or created alongside the db with db:setup). (This is also known as the "Stop Putting Gawd Damn Seed Data In Your Migrations" feature) [DHH]
Diffstat (limited to 'railties/lib/rails_generator/generators/applications')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index 2c31d89538..c8c2239f34 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -125,6 +125,7 @@ class AppGenerator < Rails::Generator::Base create_database_configuration_file(m) create_routes_file(m) create_locale_file(m) + create_seeds_file(m) create_initializer_files(m) create_environment_files(m) end @@ -176,6 +177,10 @@ class AppGenerator < Rails::Generator::Base m.file "configs/routes.rb", "config/routes.rb" end + def create_seeds_file(m) + m.file "configs/seeds.rb", "db/seeds.rb" + end + def create_initializer_files(m) %w( backtrace_silencers |