diff options
author | Akira Matsuda <ronnie@dio.jp> | 2017-08-22 19:10:00 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 19:10:00 +0900 |
commit | 02b5453331df9326763780341ad816fdb9a98d07 (patch) | |
tree | 56963d44c52c5624b35b936b0aff1421a9d7157d /activerecord/lib/active_record | |
parent | 1fe41329c6ffcbb52c9762d28d780e838584e63d (diff) | |
parent | 30ef715d40cd49d017524824bfbb92e4bd4ab6a4 (diff) | |
download | rails-02b5453331df9326763780341ad816fdb9a98d07.tar.gz rails-02b5453331df9326763780341ad816fdb9a98d07.tar.bz2 rails-02b5453331df9326763780341ad816fdb9a98d07.zip |
Merge pull request #23425 from yui-knk/support_sti_automatically_inverse
Automatically guess the inverse associations for STI
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index b847933b2e..e35049bb41 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -657,7 +657,7 @@ module ActiveRecord # from calling +klass+, +reflection+ will already be set to false. def valid_inverse_reflection?(reflection) reflection && - klass.name == reflection.active_record.name && + klass <= reflection.active_record && can_find_inverse_of_automatically?(reflection) end |