diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-05-07 08:28:42 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-05-07 08:28:42 +0000 |
commit | 0adcd811f945603a8037febaa158bbc1ffaba9d1 (patch) | |
tree | 81cfd5568be550302c60b076b29314d5e59db688 /railties/lib/rails_generator/generators | |
parent | d08d89c09285ac6c65273c935a1afbbc983f7544 (diff) | |
download | rails-0adcd811f945603a8037febaa158bbc1ffaba9d1.tar.gz rails-0adcd811f945603a8037febaa158bbc1ffaba9d1.tar.bz2 rails-0adcd811f945603a8037febaa158bbc1ffaba9d1.zip |
The app generator sets a session key in application.rb so apps running on the same host may distinguish their cookies. Closes #2967.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4328 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/generators')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 5 |
1 files changed, 3 insertions, 2 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 a61331b5b3..44386f7ac2 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -14,6 +14,7 @@ class AppGenerator < Rails::Generator::Base usage if args.empty? usage("Databases supported for preconfiguration are: #{DATABASES.join(", ")}") if (options[:db] && !DATABASES.include?(options[:db])) @destination_root = args.shift + @app_name = File.basename(File.expand_path(@destination_root)) end def manifest @@ -31,13 +32,13 @@ class AppGenerator < Rails::Generator::Base m.file "README", "README" # Application - m.template "helpers/application.rb", "app/controllers/application.rb" + m.template "helpers/application.rb", "app/controllers/application.rb", :assigns => { :app_name => @app_name } m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb" m.template "helpers/test_helper.rb", "test/test_helper.rb" # database.yml and .htaccess m.template "configs/databases/#{options[:db]}.yml", "config/database.yml", :assigns => { - :app_name => File.basename(File.expand_path(@destination_root)), + :app_name => @app_name, :socket => options[:db] == "mysql" ? mysql_socket_location : nil } m.template "configs/routes.rb", "config/routes.rb" |