Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

active support class to path conventions for autoload

#6664

I want to have an ability to setup my own class to path convention for autoloading feature, ie:

Normally AS works like that
MyNew::Class::Path => my_new/class/path

I want this:
MyNew::Class::Path => MyNew/Class/Path

To do this I introduced:

  • class_to_path_conventions = []
  • class_to_path_conventions << lambda { |c| c.underscore }
  • class_to_path_conventions << lambda { |c| c.gsub('::', '/') }

Where the first convention is ruby and rails convention, while the second one is mine.
We don't need to hardcode my convention into Rails, but what do you think to setup an API to add someone others conventions?
Please, advise where we can put class_to_path_conventions array into API.

Reported by Dawid Marcin Grzesiak · April 2nd, 2011 @ 10:52 PM

State: new
Milestone: none
Assigned to: nobody
Importance: none