This project is archived and is in readonly mode.

#6681 ✓committed
Amir

Ordinalize Negative Numbers

Reported by Amir | April 7th, 2011 @ 09:22 AM | in 3.1

This patch fixes the ordinalize method for negative numbers. I added inflector test cases that address this issue and provided a brief example below. This patch changes the ordinalize method to use the absolute value of the number when determining which suffix to append.

Currently:

> -1.ordinalize
=> "-1th"

After patching:

> -1.ordinalize
=> "-1st"

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>

Attachments

Pages