diff options
author | Arthur Neves <arthurnn@gmail.com> | 2014-04-18 01:11:47 -0400 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2014-04-18 01:12:27 -0400 |
commit | c0b6e164ee6bbc7941d280ea629d70d400561668 (patch) | |
tree | 63671b17de93268ad67b6162d4cedec67eb858ab /activerecord | |
parent | bcfa2bf958ebd9e381944bd93ee2f436a1edd375 (diff) | |
download | rails-c0b6e164ee6bbc7941d280ea629d70d400561668.tar.gz rails-c0b6e164ee6bbc7941d280ea629d70d400561668.tar.bz2 rails-c0b6e164ee6bbc7941d280ea629d70d400561668.zip |
Regression test for irregular inflection on has_many
Also add a Changelog entry
[related #9702]
[fixes #8928]
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG.md | 6 | ||||
-rw-r--r-- | activerecord/test/cases/reflection_test.rb | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 57a083c1df..0cba1009b6 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -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. diff --git a/activerecord/test/cases/reflection_test.rb b/activerecord/test/cases/reflection_test.rb index fed199f6e9..c085fcf161 100644 --- a/activerecord/test/cases/reflection_test.rb +++ b/activerecord/test/cases/reflection_test.rb @@ -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 |