Skip to content
Browse files

Refactor identifying generator's destination root

  • Loading branch information...
1 parent a0ee227 commit 5f00592466bd91107ecdfd055140cb2b36e29f50 Stefan Sprenger committed May 27, 2011
Showing with 2 additions and 5 deletions.
  1. +2 −5 railties/lib/rails/commands/generate.rb
View
7 railties/lib/rails/commands/generate.rb
@@ -8,8 +8,5 @@
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

0 comments on commit 5f00592

Please sign in to comment.
Something went wrong with that request. Please try again.