diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-05-15 22:24:57 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 22:24:57 +0900 |
commit | 13d6aa3a7b70bca66c4abda7721329ad1863c24c (patch) | |
tree | f1ce8b480b853df1f32cd7ab5f7e92a0d62e1508 /activerecord/test/models/rating.rb | |
parent | a2708473b150b30a00c80d64f57a8c4b41a32fcc (diff) | |
parent | ec6dfdc8d21031e07dd381853ff37fcc63f8bd86 (diff) | |
download | rails-13d6aa3a7b70bca66c4abda7721329ad1863c24c.tar.gz rails-13d6aa3a7b70bca66c4abda7721329ad1863c24c.tar.bz2 rails-13d6aa3a7b70bca66c4abda7721329ad1863c24c.zip |
Merge pull request #36284 from kamipo/fix_eager_loading_with_string_joins
Fix eager loading associations with string joins not to raise NoMethodError
Diffstat (limited to 'activerecord/test/models/rating.rb')
-rw-r--r-- | activerecord/test/models/rating.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/rating.rb b/activerecord/test/models/rating.rb index 49aa38285f..2a18ea45ac 100644 --- a/activerecord/test/models/rating.rb +++ b/activerecord/test/models/rating.rb @@ -4,4 +4,5 @@ class Rating < ActiveRecord::Base belongs_to :comment has_many :taggings, as: :taggable has_many :taggings_without_tag, -> { left_joins(:tag).where("tags.id": nil) }, as: :taggable, class_name: "Tagging" + has_many :taggings_with_no_tag, -> { joins("LEFT OUTER JOIN tags ON tags.id = taggings.tag_id").where("tags.id": nil) }, as: :taggable, class_name: "Tagging" end |