On Wed, May 12, 2010 at 4:36 PM, Mislav Marohnić
<mislav.maroh...@gmail.com> wrote:

> When you're querying a parent that doesn't have any non-abstract parent
> (meaning he's the top of the STI hierarchy), then theoretically you really
> don't have to know the list of descendants. AR could just make a query
> without conditions.

Exactly, that is why in the last example in Neeraj's gist there's no
conditions on the type column even if you load the subclasses:

    http://gist.github.com/398486

I added a couple of comments at the bottom.

Neeraj these are just two techniques that do not match
transparently. Do you see what is going on now?

I think the ticket could be closed, but a warn about
this gotcha could be helpful both in the API and guides. Santiago
Pastorino is about to add it.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-c...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to