diff options
author | Carl Lerche <carllerche@mac.com> | 2010-02-01 13:43:17 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-02-01 13:43:17 -0800 |
commit | ff7a6a9b41937e8bc8e3259af09afe520a19c03e (patch) | |
tree | d00a9c22168a9fd47daecfccf3ab493a1d57d7c9 /railties/lib/generators/rails/app/app_generator.rb | |
parent | bf1f70d8776e28f9181faefc4914059b4ad26b99 (diff) | |
download | rails-ff7a6a9b41937e8bc8e3259af09afe520a19c03e.tar.gz rails-ff7a6a9b41937e8bc8e3259af09afe520a19c03e.tar.bz2 rails-ff7a6a9b41937e8bc8e3259af09afe520a19c03e.zip |
Add the database adapter in the generated Gemfile
Diffstat (limited to 'railties/lib/generators/rails/app/app_generator.rb')
-rw-r--r-- | railties/lib/generators/rails/app/app_generator.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/generators/rails/app/app_generator.rb b/railties/lib/generators/rails/app/app_generator.rb index 2e34992b3b..918bb98db8 100644 --- a/railties/lib/generators/rails/app/app_generator.rb +++ b/railties/lib/generators/rails/app/app_generator.rb @@ -90,6 +90,18 @@ module Rails::Generators template "config/boot.rb" end + def gem_for_database + # %w( mysql oracle postgresql sqlite3 frontbase ibm_db ) + case options[:database] + when "mysql" then "mysql" + when "oracle" then "ruby-oci8" + when "postgresql" then "pg" + when "sqlite3" then "sqlite3-ruby" + when "frontbase" then "ruby-frontbase" + when "ibm_db" then "ibm_db" + end + end + def create_activerecord_files return if options[:skip_activerecord] template "config/databases/#{options[:database]}.yml", "config/database.yml" |