Skip to content

Inflector should classify('status') to 'Status' - not 'Statu' #2317

pzol opened this Issue Jul 28, 2011 · 2 comments

3 participants

pzol commented Jul 28, 2011
ActiveSupport::Inflector.classify 'status'
 => "Statu" 

instead it should return

ActiveSupport::Inflector.classify 'status'
=> "Status"
@pzol pzol closed this Jul 28, 2011
Ruby on Rails member

I'm assuming you closed this as classify works on a plural name like 'statuses' and not a singular name where you need to use camelize - if you close a ticket please give the reason so that it helps other people who might be searching for something similar.


"status".pluralize.classify.constantize # => Status

"statuses".pluralize.classify.constantize # => Status

the "classify" method singularizes the string and camelizes it if its snake case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.