提交 b4f4d038 编写于 作者: D David Heinemeier Hansson

Fixed the Inflector to handle the movie/movies pair correctly #261 [Scott Baron]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@60 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 d1856a00
......@@ -48,6 +48,7 @@ def foreign_key(class_name, separate_class_name_and_id_with_underscore = true)
def plural_rules #:doc:
[
[/(x|ch|ss)$/, '\1es'], # search, switch, fix, box, process, address
[/([^aeiouy]|qu)ies$/, '\1y'],
[/([^aeiouy]|qu)y$/, '\1ies'], # query, ability, agency
[/(?:([^f])fe|([lr])f)$/, '\1\2ves'], # half, safe, wife
[/sis$/, 'ses'], # basis, diagnosis
......
*CVS*
* Fixed the Inflector to handle the movie/movies pair correctly #261 [Scott Baron]
* Added bind-style variable interpolation for the condition arrays that uses the adapter's quote method [Michael Koziarski]
Before:
......
......@@ -63,6 +63,7 @@ def plural_rules #:doc:
def singular_rules #:doc:
[
[/(x|ch|ss)es$/, '\1'],
[/movies$/, 'movie'],
[/([^aeiouy]|qu)ies$/, '\1y'],
[/([lr])ves$/, '\1f'],
[/([^f])ves$/, '\1fe'],
......
......@@ -15,6 +15,7 @@ class InflectorTest < Test::Unit::TestCase
"query" => "queries",
"ability" => "abilities",
"agency" => "agencies",
"movie" => "movies",
"wife" => "wives",
"safe" => "saves",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册