diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-05-08 17:39:02 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-05-09 22:26:55 +0200 |
commit | f4511690994f0c14c60320bbeecc66549332dbee (patch) | |
tree | d96262e1fe5de95b10b472929f916b2bf784c074 /activerecord/test/models | |
parent | 28232ce99cea0d006de7b135efad2674e3f65c38 (diff) | |
download | rails-f4511690994f0c14c60320bbeecc66549332dbee.tar.gz rails-f4511690994f0c14c60320bbeecc66549332dbee.tar.bz2 rails-f4511690994f0c14c60320bbeecc66549332dbee.zip |
test, regression test for has_many with instance dependent scope.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/author.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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) } |