This post originated from an RSS feed registered with Ruby Buzz
by Jeremy Voorhis.
Original Post: Plugins and the Inflector
Feed Title: JVoorhis
Feed URL: http://feeds.feedburner.com/jvoorhis
Feed Description: JVoorhis is a Rubyist in northeast Ohio. He rambles about Ruby on Rails, development practices, other frameworks such as Django, and on other days he is just full of snark.
This is just a quick warning to anybody who may be using custom rules with the Rails inflector.
In a personal project I am tooling around with, I define the following custom rule for the inflector:
Inflector.inflections do |inflect|
inflect.uncountable 'trash'
end
but a named route defined by the simply_restful plugin gets the helper trashes_url. Of course, this makes perfect sense – by the time your app is loading your custom inflections, your plugins are already available to be used. simply_restful had pluralized my uncountable word and defined my named routes before I ever had a chance to object.
The interesting question here is which behavior is correct?