diff options
author | Javier Goizueta <jgoizueta@gmail.com> | 2013-03-13 16:54:25 +0100 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2014-04-18 01:09:37 -0400 |
commit | bcfa2bf958ebd9e381944bd93ee2f436a1edd375 (patch) | |
tree | 09fee7ab9e9cdc7e9ffc33bdbadf99b29d7768ec /activerecord/lib | |
parent | 542457b5d2f56baafd60a0e46f1bfb9eb481e61b (diff) | |
download | rails-bcfa2bf958ebd9e381944bd93ee2f436a1edd375.tar.gz rails-bcfa2bf958ebd9e381944bd93ee2f436a1edd375.tar.bz2 rails-bcfa2bf958ebd9e381944bd93ee2f436a1edd375.zip |
Singularize association names before camelization
So that irregular multi-word pluralization rules have to be defined only for snake-case strings.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |