diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2013-08-14 23:55:33 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2013-08-14 23:55:33 -0700 |
commit | e90f0e0eb68825b7a07e2f468272a138107154c3 (patch) | |
tree | 167b7ecc14900b0ec78414e2e5bc53cc42acd874 /activerecord/lib/active_record | |
parent | e6b9f130a658977e3f9ddce106d321b55af916b7 (diff) | |
parent | c9e2fa22cbf74f8184e502e7726fcfbe33bdb3e6 (diff) | |
download | rails-e90f0e0eb68825b7a07e2f468272a138107154c3.tar.gz rails-e90f0e0eb68825b7a07e2f468272a138107154c3.tar.bz2 rails-e90f0e0eb68825b7a07e2f468272a138107154c3.zip |
Merge pull request #11897 from wangjohn/fixing_multiple_word_inverse_detection
Fixing multi-word automatic inverse detection.
Diffstat (limited to 'activerecord/lib/active_record')
-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 73d154e03e..f428f160cf 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -394,7 +394,7 @@ module ActiveRecord # returns either nil or the inverse association name that it finds. def automatic_inverse_of if can_find_inverse_of_automatically?(self) - inverse_name = active_record.name.downcase.to_sym + inverse_name = ActiveSupport::Inflector.underscore(active_record.name).to_sym begin reflection = klass.reflect_on_association(inverse_name) @@ -413,7 +413,7 @@ module ActiveRecord end # Checks if the inverse reflection that is returned from the - # +set_automatic_inverse_of+ method is a valid reflection. We must + # +automatic_inverse_of+ method is a valid reflection. We must # make sure that the reflection's active_record name matches up # with the current reflection's klass name. # |