diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-18 10:51:21 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-18 10:51:21 -0300 |
commit | d1756ba91b7e5ff80322f434f8348e6e471f0511 (patch) | |
tree | c03099883cc58cf3d870e56695d4f1646d61ab83 /activerecord/test | |
parent | a3fd6e7fa9be80e7f53fec99d0c1bfb5e2a52c5e (diff) | |
parent | c0b6e164ee6bbc7941d280ea629d70d400561668 (diff) | |
download | rails-d1756ba91b7e5ff80322f434f8348e6e471f0511.tar.gz rails-d1756ba91b7e5ff80322f434f8348e6e471f0511.tar.bz2 rails-d1756ba91b7e5ff80322f434f8348e6e471f0511.zip |
Merge pull request #14793 from arthurnn/fixes_8928
Fixed has_many association to make it support irregular inflections.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/reflection_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |