diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index 7ee414f34bf5c70d5effa78e4a0652e1797483b9..c1a79189bd59693efb31ea18666fb8661229c55d 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -1276,6 +1276,29 @@ end NOTE: Defined in +active_support/core_ext/string/inflections.rb+. +h5. +singularize+ + +The inverse of +pluralize+: + + +"tables".singularize # => "table" +"rubies".singularize # => "ruby" +"equipment".singularize # => "equipment" + + +Associations compute the name of the corresponding default associated class using this method: + + +# active_record/reflection.rb +def derive_class_name + class_name = name.to_s.camelize + class_name = class_name.singularize if collection? + class_name +end + + +NOTE: Defined in +active_support/core_ext/string/inflections.rb+. + h3. Extensions to +Numeric+ h4. Bytes