diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-27 15:16:09 -0300 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-27 15:16:09 -0300 |
commit | 469eafa70f2c293d462e2880fbf52203d5145708 (patch) | |
tree | 35186678fca94fe742eeb31fc1d62d9ecc73a6cd /railties/lib/rails | |
parent | f77e211a01b56adbe2a408d9a6636931c0aee093 (diff) | |
download | rails-469eafa70f2c293d462e2880fbf52203d5145708.tar.gz rails-469eafa70f2c293d462e2880fbf52203d5145708.tar.bz2 rails-469eafa70f2c293d462e2880fbf52203d5145708.zip |
add the database gem
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 8 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/Gemfile | 7 |
3 files changed, 8 insertions, 9 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 6154b2068b..e760f78977 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -121,11 +121,9 @@ module Rails end def database_gemfile_entry - options[:skip_active_record] ? "" : - <<-GEMFILE.strip_heredoc - # Use #{options[:database]} as the database for Active Record - gem '#{gem_for_database}' - GEMFILE + return [] if options[:skip_active_record] + gem = GemfileGem.new gem_for_database, "Use #{options[:database]} as the database for Active Record" + return [gem] end def include_all_railties? diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 42b9fe9a34..0e695a54a1 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -163,7 +163,7 @@ module Rails end def gemfile_gems - rails_gemfile_entry + rails_gemfile_entry + database_gemfile_entry end public_task :set_default_accessors! diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 21dc915aab..90e2fc9311 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -2,7 +2,10 @@ source 'https://rubygems.org' <% max_width = gemfile_gems.map { |g| g.name.length }.max -%> <% gemfile_gems.each do |gem| -%> -<%= gem.comment -%> +<% if gem.comment -%> + +# <%= gem.comment %> +<% end -%> <% if gem.version -%> gem '<%= gem.name %>',<%= gem.padding(max_width) %>'<%= gem.version %>' <% elsif gem.path -%> @@ -14,8 +17,6 @@ gem '<%= gem.name %>' <% end -%> <% end -%> -<%= database_gemfile_entry -%> - <%= assets_gemfile_entry %> <%= javascript_gemfile_entry -%> |