aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorFlorian Weber <csshsh@gmail.com>2005-10-16 09:51:04 +0000
committerFlorian Weber <csshsh@gmail.com>2005-10-16 09:51:04 +0000
commita1f14d1a85b3abd36cd6cdd093d11fd4bbd4605e (patch)
treed1617c941e2df57a4754e3324a106eb5f299ab11 /railties
parent4db7def575739b0b8d8d8c3d5e7f5892844a1a78 (diff)
downloadrails-a1f14d1a85b3abd36cd6cdd093d11fd4bbd4605e.tar.gz
rails-a1f14d1a85b3abd36cd6cdd093d11fd4bbd4605e.tar.bz2
rails-a1f14d1a85b3abd36cd6cdd093d11fd4bbd4605e.zip
Made the rails command use the application name for database names in the tailored database.yml file.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2642 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/configs/database.yml6
-rw-r--r--railties/lib/rails_generator/generators/applications/app/app_generator.rb2
3 files changed, 6 insertions, 4 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index f26478836c..e5f84eb85d 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Made the rails command use the application name for database names in the tailored database.yml file. Example: "rails ~/projects/blog" will use "blog_development" instead of "rails_development". [Florian Weber]
+
* Added Rails framework freezing tasks: freeze_gems (freeze to current gems), freeze_edge (freeze to Rails SVN trunk), unfreeze_rails (float with newest gems on system)
* Added update_javascripts task which will fetch all the latest js files from your current rails install. Use after updating rails. [Tobias Luetke]
diff --git a/railties/configs/database.yml b/railties/configs/database.yml
index e8977ea352..b72fd61bc7 100644
--- a/railties/configs/database.yml
+++ b/railties/configs/database.yml
@@ -1,6 +1,6 @@
development:
adapter: mysql
- database: rails_development
+ database: <%= app_name %>_development
host: localhost
username: root
password:
@@ -12,14 +12,14 @@ development:
# Do not set this db to the same as development or production.
test:
adapter: mysql
- database: rails_test
+ database: <%= app_name %>_test
host: localhost
username: root
password:
production:
adapter: mysql
- database: rails_production
+ database: <%= app_name %>_production
host: localhost
username: root
password:
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 a5b5c14797..447e27977c 100644
--- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb
+++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -32,7 +32,7 @@ class AppGenerator < Rails::Generator::Base
m.template "helpers/test_helper.rb", "test/test_helper.rb"
# database.yml and .htaccess
- m.template "configs/database.yml", "config/database.yml"
+ m.template "configs/database.yml", "config/database.yml", :assigns => { :app_name => File.basename(@destination_root) }
m.template "configs/routes.rb", "config/routes.rb"
m.template "configs/apache.conf", "public/.htaccess"