diff options
author | Stefan Sprenger <stefan.sprenger@dkd.de> | 2011-05-27 13:25:35 +0200 |
---|---|---|
committer | Stefan Sprenger <stefan.sprenger@dkd.de> | 2011-05-27 13:29:22 +0200 |
commit | 5f00592466bd91107ecdfd055140cb2b36e29f50 (patch) | |
tree | 128ddd088c056e8f7a84eaaf8220356e20eb3640 /railties | |
parent | a0ee2270d3e0bdcc0433e4af56c616f71553378c (diff) | |
download | rails-5f00592466bd91107ecdfd055140cb2b36e29f50.tar.gz rails-5f00592466bd91107ecdfd055140cb2b36e29f50.tar.bz2 rails-5f00592466bd91107ecdfd055140cb2b36e29f50.zip |
Refactor identifying generator's destination root
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/commands/generate.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/railties/lib/rails/commands/generate.rb b/railties/lib/rails/commands/generate.rb index 1f742f8853..1fb2d98834 100644 --- a/railties/lib/rails/commands/generate.rb +++ b/railties/lib/rails/commands/generate.rb @@ -8,8 +8,5 @@ end name = ARGV.shift -if defined?(ENGINE_ROOT) - Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => ENGINE_ROOT -else - Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => Rails.root -end +root = defined?(ENGINE_ROOT) ? ENGINE_ROOT : Rails.root +Rails::Generators.invoke name, ARGV, :behavior => :invoke, :destination_root => root |