This project is archived and is in readonly mode.

#6460 ✓invalid
Guillaume Laville

active_support/core_ext/string/inflections doesn't load default inflections

Reported by Guillaume Laville | February 22nd, 2011 @ 09:26 AM | in 3.x

Requiring 'active_support/core_ext/string/inflections'
doesn't load default inflections (active_support/inflections) in AS 3.0.4 :

When using AS as a standalone library (such as in mail gem, https://github.com/mikel/mail)
this may result in broken String#singularize/String#pluralize methods which can go unnotticed
(the mentionned gem only actually use String#constantize).

Others libraries, such as Sequel, try to use these methods if they are defined instead
of their own implementation, which produces nasty bugs later in the program without any
actual action from the user other than requiring both the mail and sequel libraries.

Is directly loading 'active_support/core_ext/string/inflections' (or indirectly,
via 'active_support/core_ext/string') without defining its own inflections considered bad form,
in which case I may report the problem to the mail author, or should the default
inflections be always loaded ?

(The test suite case for core_ext/string doesn't appear to be affected thanks to an implicit active_support/inflections loading done by one of the explicit requires).

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>

Pages