1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib
Jon Leighton 55193e449a 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.
2013-06-28 11:47:00 +01:00
..
active_record Apply default scope when joining associations. 2013-06-28 11:47:00 +01:00
rails/generators copy edits[ci skip] 2013-05-19 21:38:23 +05:30
active_record.rb Remove depreacted finders 2013-06-28 00:24:11 +02:00