Plugins and the Inflector - A Stopgap Measure

Posted by Jeremy Voorhis Wed, 26 Jul 2006 02:02:00 GMT

While reading through the source of Rails::Initializer, I discovered and confirmed a solution to ordering problem documented at http://www.jvoorhis.com/articles/2006/06/30/plugins-and-the-inflector.

The individual environment files (config/environments/development.rb, et. al.) are loaded before any plugins are loaded, while the last portion of config/environment.rb is loaded after plugins are loaded.

This means that you can declare your custom inflections in those individual environment files. Just be sure that your inflections are shared across all three files. A good solution might be to create config/inflections.rb and require it in all three sites.

Comments

(leave url/email »)