diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/inflector.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb index f5c92cf4d9..087c883b0b 100644 --- a/activesupport/lib/active_support/inflector.rb +++ b/activesupport/lib/active_support/inflector.rb @@ -134,8 +134,7 @@ module Inflector end def foreign_key(class_name, separate_class_name_and_id_with_underscore = true) - Inflector.underscore(Inflector.demodulize(class_name)) + - (separate_class_name_and_id_with_underscore ? "_id" : "id") + underscore(demodulize(class_name)) + (separate_class_name_and_id_with_underscore ? "_id" : "id") end def constantize(camel_cased_word) |