diff options
author | Jon Leighton <j@jonathanleighton.com> | 2013-04-19 12:52:44 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2013-06-28 11:47:00 +0100 |
commit | 55193e449a377c448e43d8fec42899ea1ff93b27 (patch) | |
tree | dfda1e0a1c4ee49d7f40304277afddc26c062b13 /activerecord/lib/active_record/associations/join_dependency.rb | |
parent | 4642f5487a491de283910c662a519f14c21e136f (diff) | |
download | rails-55193e449a377c448e43d8fec42899ea1ff93b27.tar.gz rails-55193e449a377c448e43d8fec42899ea1ff93b27.tar.bz2 rails-55193e449a377c448e43d8fec42899ea1ff93b27.zip |
Apply default scope when joining associations.
For example:
class Post < ActiveRecord::Base
default_scope -> { where published: true }
end
class Comment
belongs_to :post
end
When calling `Comment.join(:post)`, we expect to receive only
comments on published posts, since that is the default scope for
posts.
Before this change, the default scope from `Post` was not applied,
so we'd get comments on unpublished posts.
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency.rb')
0 files changed, 0 insertions, 0 deletions