diff options
author | Aditya Sanghi <asanghi@me.com> | 2011-05-06 20:59:15 +0530 |
---|---|---|
committer | Aditya Sanghi <asanghi@me.com> | 2011-05-06 20:59:15 +0530 |
commit | cdf1842caafb805e42c3354795e08e20cf2902f1 (patch) | |
tree | 5625218bd480cbc9cd18253e2b767ac54418264a /railties/lib | |
parent | 9b5c29038df3ffc4a4038aac7e5cba0c5b088729 (diff) | |
download | rails-cdf1842caafb805e42c3354795e08e20cf2902f1.tar.gz rails-cdf1842caafb805e42c3354795e08e20cf2902f1.tar.bz2 rails-cdf1842caafb805e42c3354795e08e20cf2902f1.zip |
review fixes
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 8 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/application.rb | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 3d16304d86..e8709b2ddd 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -120,6 +120,14 @@ module Rails options[:skip_active_record] ? "" : "gem '#{gem_for_database}'\n" end + def include_all_railties? + !options[:skip_active_record] && !options[:skip_test_unit] + end + + def comment_if(value) + options[value] ? '#' : '' + end + def rails_gemfile_entry if options.dev? <<-GEMFILE.strip_heredoc diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index 430468afb4..e1946807b0 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -1,14 +1,14 @@ require File.expand_path('../boot', __FILE__) -<% if !options[:skip_active_record] && !options[:skip_test_unit] -%> +<% if include_all_railties? -%> require 'rails/all' <% else -%> # Pick the frameworks you want: -<%= options[:skip_active_record] ? "#" : "" %> require "active_record/railtie" +<%= comment_if :skip_active_record %> require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "active_resource/railtie" -<%= options[:skip_test_unit] ? "#" : "" %> require "rails/test_unit/railtie" +<%= comment_if :skip_test_unit %> require "rails/test_unit/railtie" <% end -%> # If you have a Gemfile, require the gems listed there, including any gems @@ -59,8 +59,6 @@ module <%= app_const_base %> <% unless options[:skip_active_record] -%> # Enable IdentityMap for Active Record, to disable set to false or remove the line below. config.active_record.identity_map = true -<% else -%> - config.generators.orm = false <% end -%> # Enable the asset pipeline |