module Rails::Generators

def self.invoke_fallbacks_for(name, base) #:nodoc:

:nodoc:
Try fallbacks for the given base.
def self.invoke_fallbacks_for(name, base) #:nodoc:
  return nil unless base && fallbacks[base.to_sym]
  invoked_fallbacks = []
  Array(fallbacks[base.to_sym]).each do |fallback|
    next if invoked_fallbacks.include?(fallback)
    invoked_fallbacks << fallback
    klass = find_by_namespace(name, fallback)
    return klass if klass
  end
  nil
end