aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJavier Goizueta <jgoizueta@gmail.com>2013-03-13 16:54:25 +0100
committerArthur Neves <arthurnn@gmail.com>2014-04-18 01:09:37 -0400
commitbcfa2bf958ebd9e381944bd93ee2f436a1edd375 (patch)
tree09fee7ab9e9cdc7e9ffc33bdbadf99b29d7768ec /activerecord
parent542457b5d2f56baafd60a0e46f1bfb9eb481e61b (diff)
downloadrails-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')
-rw-r--r--activerecord/lib/active_record/reflection.rb4
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