1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Regression test for irregular inflection on has_many

Also add a Changelog entry

[related #9702]
[fixes #8928]
This commit is contained in:
Arthur Neves 2014-04-18 01:11:47 -04:00
parent bcfa2bf958
commit c0b6e164ee
No known key found for this signature in database
GPG key ID: 04A390FB1E433E17
2 changed files with 14 additions and 0 deletions

View file

@ -1,3 +1,9 @@
* 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.

View file

@ -87,6 +87,14 @@ class ReflectionTest < ActiveRecord::TestCase
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