diff --git a/lib/automatic_namespaces/autoloader.rb b/lib/automatic_namespaces/autoloader.rb index eb51714..2b48efb 100644 --- a/lib/automatic_namespaces/autoloader.rb +++ b/lib/automatic_namespaces/autoloader.rb @@ -36,6 +36,11 @@ def excluded_directories(metadata) def define_namespace(pack, metadata) namespace_name = metadata['namespace_override'] || pack.last_name.camelize + begin + require "./#{pack.name}/app/models/#{namespace_name.underscore}" + rescue LoadError + nil + end namespace_object = Object namespace_name.split('::').each do |module_name| namespace_object = find_or_create_module(namespace_object, module_name)