forked from pengwynn/gowalla
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove activesupport pluralize in favor of poor-mans version
- Loading branch information
1 parent
500c1c7
commit 7fc14e2
Showing
5 changed files
with
15 additions
and
5 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
if !String.method_defined?(:pluralize) | ||
|
||
class String | ||
puts 'defining pluralize' | ||
def pluralize | ||
case self[self.length - 1] | ||
when 'y' then self[0..self.length - 2] + 'ies' | ||
when 's' then self | ||
else self + 's' | ||
end | ||
end | ||
end | ||
|
||
end |