mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
add the database gem
This commit is contained in:
parent
f77e211a01
commit
469eafa70f
3 changed files with 8 additions and 9 deletions
|
@ -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?
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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 -%>
|
||||
|
||||
|
|
Loading…
Reference in a new issue