RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: tovodeverett
My understanding is that calling singularize before classify is redundant and can lead to problems with singular forms that end with "s". See http://apidock.com/rails/ActiveSupport/Inflector/classify and http://apidock.com/rails/ActiveSupport/Inflector/camelize. To be safe, classify should only be called on a plural form. The camelize method can be called on either and will return a result with the same grammatical number (i.e. singular or plural). Of note, the source for classify (at least in 3.2.8) is:
Repeated calls to singularize are not necessarily safe:
"businesses".singularize # => "business"
"business".singularize # => "busines"
"busines".singularize # => "busine"
"busine".singularize # => "busine"