Permalink
Browse files

Singularize association names before camelization

So that irregular multi-word pluralization rules have to be defined only for snake-case strings.
  • Loading branch information...
1 parent 542457b commit bcfa2bf958ebd9e381944bd93ee2f436a1edd375 @jgoizueta jgoizueta committed with arthurnn Mar 13, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/reflection.rb
@@ -449,9 +449,9 @@ def can_find_inverse_of_automatically?(reflection)
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

0 comments on commit bcfa2bf

Please sign in to comment.