diff options
author | Kassio Borges <kassioborgesm@gmail.com> | 2014-08-18 18:18:34 -0300 |
---|---|---|
committer | Kassio Borges <kassioborgesm@gmail.com> | 2014-08-18 18:20:40 -0300 |
commit | 7aeca5066ada5077cb6aaf7fb331a146afc76cfd (patch) | |
tree | c5a2588e1f1659e441a2e8bce442e2aed5e36eb4 /activerecord/test/models/post.rb | |
parent | 986dee5ca1db38ddb2e5394a0cc88831b175e018 (diff) | |
download | rails-7aeca5066ada5077cb6aaf7fb331a146afc76cfd.tar.gz rails-7aeca5066ada5077cb6aaf7fb331a146afc76cfd.tar.bz2 rails-7aeca5066ada5077cb6aaf7fb331a146afc76cfd.zip |
Fixes the `Relation#exists?` to work with polymorphic associations.
Fixes #15821.
Diffstat (limited to 'activerecord/test/models/post.rb')
-rw-r--r-- | activerecord/test/models/post.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index a29858213b..56a31011da 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -41,6 +41,7 @@ class Post < ActiveRecord::Base scope :with_tags, -> { preload(:taggings) } scope :tagged_with, ->(id) { joins(:taggings).where(taggings: { tag_id: id }) } + scope :tagged_with_comment, ->(comment) { joins(:taggings).where(taggings: { comment: comment }) } has_many :comments do def find_most_recent |