diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-21 13:44:08 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-21 13:44:08 +0100 |
commit | 4477bccda6d388755c46326df964850962c12c5d (patch) | |
tree | f3ffa5924c0ebd5cc9788ae59f9ee5c75859b834 /railties/lib/rails | |
parent | 7fe4ca3253e902c67d4765eeece285ffc49f3d89 (diff) | |
download | rails-4477bccda6d388755c46326df964850962c12c5d.tar.gz rails-4477bccda6d388755c46326df964850962c12c5d.tar.bz2 rails-4477bccda6d388755c46326df964850962c12c5d.zip |
Also check if application is a valid constant in rake rails:update.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/tasks/framework.rake | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/railties/lib/rails/tasks/framework.rake b/railties/lib/rails/tasks/framework.rake index 65d3c48f2d..dbe2ac54ed 100644 --- a/railties/lib/rails/tasks/framework.rake +++ b/railties/lib/rails/tasks/framework.rake @@ -32,12 +32,18 @@ namespace :rails do namespace :update do def invoke_from_app_generator(method) - require 'rails/generators' - require 'generators/rails/app/app_generator' + app_generator.invoke(method) + end - generator = Rails::Generators::AppGenerator.new ["rails"], { :with_dispatchers => true }, - :destination_root => Rails.root - generator.invoke(method) + def app_generator + @app_generator ||= begin + require 'rails/generators' + require 'generators/rails/app/app_generator' + gen = Rails::Generators::AppGenerator.new ["rails"], { :with_dispatchers => true }, + :destination_root => Rails.root + gen.send(:valid_app_const?) + gen + end end desc "Update config/boot.rb from your current rails install" |