From f4511690994f0c14c60320bbeecc66549332dbee Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Thu, 8 May 2014 17:39:02 +0200 Subject: test, regression test for has_many with instance dependent scope. --- activerecord/test/models/author.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index c197951c71..f2463de522 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -140,6 +140,8 @@ class Author < ActiveRecord::Base has_many :posts_with_default_include, :class_name => 'PostWithDefaultInclude' has_many :comments_on_posts_with_default_include, :through => :posts_with_default_include, :source => :comments + has_many :posts_with_signature, -> (record) { where("posts.title LIKE ?", "%by #{record.name.downcase}%") }, class_name: "Post" + scope :relation_include_posts, -> { includes(:posts) } scope :relation_include_tags, -> { includes(:tags) } -- cgit v1.2.3