diff options
author | yui-knk <spiketeika@gmail.com> | 2016-02-02 20:57:55 +0900 |
---|---|---|
committer | yui-knk <spiketeika@gmail.com> | 2017-08-22 18:51:43 +0900 |
commit | 30ef715d40cd49d017524824bfbb92e4bd4ab6a4 (patch) | |
tree | 56963d44c52c5624b35b936b0aff1421a9d7157d /activerecord/lib/active_record/querying.rb | |
parent | 1fe41329c6ffcbb52c9762d28d780e838584e63d (diff) | |
download | rails-30ef715d40cd49d017524824bfbb92e4bd4ab6a4.tar.gz rails-30ef715d40cd49d017524824bfbb92e4bd4ab6a4.tar.bz2 rails-30ef715d40cd49d017524824bfbb92e4bd4ab6a4.zip |
Automatically guess the inverse associations for STI
ActiveRecord associations automatically guess the inverse associations.
But this feature does not work correctly on assoctions for STI.
For example, before this commit
```
class Post < ActiveRecord::Base
belongs_to :author
end
class SpecialPost < Post; end
class Author < ActiveRecord::Base
has_many :posts
has_many :special_posts
end
```
`author.posts.first.author` works correctly, but
`author.special_posts.first.author` does not work correctly.
Diffstat (limited to 'activerecord/lib/active_record/querying.rb')
0 files changed, 0 insertions, 0 deletions