Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Default scope breaks working of has_many :through #528

Closed
wants to merge 1 commit into from

3 participants

@wakeless

Adding a default_scope to the end of a has_many :through relationship breaks a number of things.

I've found it through a :uniq => true on the relationship, but the attached change to the tests seems to break a number of other things

@josevalim
Owner

Is this a regression? Does this work on 3.0?

@josevalim
Owner

How is this different from #508?

@jonleighton jonleighton was assigned
@jonleighton
Collaborator

I am closing this in favour of an issue which I just created (#533) because we are definitely not going to merge this in its present form so we should discuss the bug in an issue. Thanks.

@jake3030 jake3030 referenced this pull request from a commit in jake3030/rails
@fcheung fcheung Ensure :include checks joins when determining if it can preload [#528
…state:resolved]
c9ab709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 12, 2011
  1. Adding default scope to posts.

    Michael Gall authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  activerecord/test/models/post.rb
View
2  activerecord/test/models/post.rb
@@ -5,6 +5,8 @@ def author
end
end
+ default_scope select("posts.*")
+
scope :containing_the_letter_a, where("body LIKE '%a%'")
scope :ranked_by_comments, order("comments_count DESC")
Something went wrong with that request. Please try again.