Regression test for irregular inflection on has_many

Also add a Changelog entry

[related #9702]
[fixes #8928]
上级 bcfa2bf9
* Fixed has_many association to make it support irregular inflections.
Fixes #8928.
*arthurnn*, *Javier Goizueta*
* Fixed a problem where count used with a grouping was not returning a Hash.
Fixes #14721.
......
......@@ -87,6 +87,14 @@ def test_reflection_klass_for_nested_class_name
end
end
def test_irregular_reflection_class_name
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'plural_irregular', 'plurales_irregulares'
end
reflection = AssociationReflection.new(:has_many, 'plurales_irregulares', nil, {}, ActiveRecord::Base)
assert_equal 'PluralIrregular', reflection.class_name
end
def test_aggregation_reflection
reflection_for_address = AggregateReflection.new(
:composed_of, :address, nil, { :mapping => [ %w(address_street street), %w(address_city city), %w(address_country country) ] }, Customer
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册