Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Fixnum#ordinalize to turn 1.ordinalize to "1st", 3.ordinalize t…
…o "3rd", and 10.ordinalize to "10th" and so on #1724 [paul@cnt.org] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1852 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
activesupport/lib/active_support/core_ext/fixnum/inflections.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
require File.dirname(__FILE__) + '/../../inflector' | |||
module ActiveSupport #:nodoc: | |||
module CoreExtensions #:nodoc: | |||
module Fixnum #:nodoc: | |||
module Inflections | |||
# 1.ordinalize # => "1st" | |||
# 3.ordinalize # => "3rd" | |||
# 10.ordinalize # => "10th" | |||
def ordinalize | |||
Inflector.ordinalize(self) | |||
end | |||
end | |||
end | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters