1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Singularize association names before camelization

So that irregular multi-word pluralization rules have to be defined only for snake-case strings.
This commit is contained in:
Javier Goizueta 2013-03-13 16:54:25 +01:00 committed by Arthur Neves
parent 542457b5d2
commit bcfa2bf958

View file

@ -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