This project is archived and is in readonly mode.

#6664 new
Dawid Marcin Grzesiak

active support class to path conventions for autoload

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

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.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages