diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-26 20:24:52 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-26 20:24:52 +0200 |
commit | 54208cbe60492d3ee8e8daf156eebc818a617181 (patch) | |
tree | aa8ba504f257c85d1a2e01236f0bddca6515bf63 /railties/lib/generators.rb | |
parent | e981aeb57633148b02a96db13d2c63bc84c4555f (diff) | |
download | rails-54208cbe60492d3ee8e8daf156eebc818a617181.tar.gz rails-54208cbe60492d3ee8e8daf156eebc818a617181.tar.bz2 rails-54208cbe60492d3ee8e8daf156eebc818a617181.zip |
Added invoke_if and make use of it on controller generators.
Diffstat (limited to 'railties/lib/generators.rb')
-rw-r--r-- | railties/lib/generators.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/generators.rb b/railties/lib/generators.rb index 4cc18e26cf..f094a1f062 100644 --- a/railties/lib/generators.rb +++ b/railties/lib/generators.rb @@ -45,7 +45,8 @@ module Rails # "test_unit:generators:model", "test_unit:model" # def self.find_by_namespace(name, base=nil, context=nil) - attempts = [ ] + name, attempts = name.to_s, [] + attempts << "#{base}:generators:#{name}" if base && name.count(':') == 0 attempts << "#{name}:generators:#{context}" if context && name.count(':') == 0 attempts << name.sub(':', ':generators:') if name.count(':') == 1 |