diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-25 21:14:43 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-25 21:14:43 +0200 |
commit | 67c2f53938654381d5d19bbdd046b82c6268aaff (patch) | |
tree | 18f514e11da22da6e1ef16d7bf4e92994078a79c /railties | |
parent | edd07b5a7a37783f398a156b2eb99b5b2733a0ae (diff) | |
download | rails-67c2f53938654381d5d19bbdd046b82c6268aaff.tar.gz rails-67c2f53938654381d5d19bbdd046b82c6268aaff.tar.bz2 rails-67c2f53938654381d5d19bbdd046b82c6268aaff.zip |
Allow templates for non namespaced generators too.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/generators/base.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/generators/base.rb b/railties/lib/generators/base.rb index 4c38e0f5be..a6a2998af5 100644 --- a/railties/lib/generators/base.rb +++ b/railties/lib/generators/base.rb @@ -158,7 +158,11 @@ module Rails if defined?(RAILS_ROOT) && base.name !~ /Base$/ path = File.expand_path(File.join(RAILS_ROOT, 'lib', 'templates')) - base.source_paths << File.join(path, base.base_name, base.generator_name) + if base.name.include?('::') + base.source_paths << File.join(path, base.base_name, base.generator_name) + else + base.source_paths << File.join(path, base.generator_name) + end end end |