From bcfa2bf958ebd9e381944bd93ee2f436a1edd375 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Wed, 13 Mar 2013 16:54:25 +0100 Subject: Singularize association names before camelization So that irregular multi-word pluralization rules have to be defined only for snake-case strings. --- activerecord/lib/active_record/reflection.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 1724ea95b0..4fde6677be 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -449,9 +449,9 @@ module ActiveRecord end def derive_class_name - class_name = name.to_s.camelize + class_name = name.to_s class_name = class_name.singularize if collection? - class_name + class_name.camelize end def derive_foreign_key -- cgit v1.2.3