diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-20 21:24:38 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 21:24:38 +0900 |
commit | df2ebf9b59b8ef063923136ba7097328db6c949f (patch) | |
tree | 3b943781a7b09f01e5091a92df87dd27039b6e1f /activerecord/test/models | |
parent | fd919ec881c8ae9e7c7e9251372109849b6888d8 (diff) | |
parent | bd4eff2f99ffa5868574c497bc63f320cbda3083 (diff) | |
download | rails-df2ebf9b59b8ef063923136ba7097328db6c949f.tar.gz rails-df2ebf9b59b8ef063923136ba7097328db6c949f.tar.bz2 rails-df2ebf9b59b8ef063923136ba7097328db6c949f.zip |
Merge pull request #35247 from bogdan/fix-source-reflection-reset-code
Fix reset of the source association when through association is loaded
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/category.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/category.rb b/activerecord/test/models/category.rb index 2ccc00bed9..8c86879dc6 100644 --- a/activerecord/test/models/category.rb +++ b/activerecord/test/models/category.rb @@ -26,6 +26,7 @@ class Category < ActiveRecord::Base has_many :categorizations has_many :special_categorizations has_many :post_comments, through: :posts, source: :comments + has_many :ordered_post_comments, -> { order(id: :desc) }, through: :posts, source: :comments has_many :authors, through: :categorizations has_many :authors_with_select, -> { select "authors.*, categorizations.post_id" }, through: :categorizations, source: :author |