http://dev.rubyonrails.org/ticket/2597

All AR unit tests now pass in MySQL, Postgress and sqlite3.

Check it out!  You can now do:

Posts.count(:include => :authors, :conditions => "authors.name = 'david'")

and (limiting with eager loading):

Posts.find(:all, :include => :authors, :conditions => "authors.name =
'david'", :limit => 10, :offset => 11)

As a bonus, these changes enable people to use paginate with :include, like:

@post_pages, @posts paginate(:posts, :per_page => 10, :include =>
:authors, :conditions => "authors.name = 'david'")

In addition to making a patch, I've also created a plugin that does
the same thing so that it's available if anyone needs it.

Thanks,
Jeremy

On 12/12/05, Jeremy Hopple <[EMAIL PROTECTED]> wrote:
> I came across this ticket: http://dev.rubyonrails.org/ticket/2760.
> The patch I submitted for http://dev.rubyonrails.org/ticket/2597 also,
> and probably more specifically, relates to this ticket.  In other
> words, the fix for #2597 depends upon the enhancement called for in
> #2760.
>
> These tickets could probably be cleaned up and consolidated.
>
> Thanks,
> Jeremy
>
> On 12/10/05, Jeremy Hopple <[EMAIL PROTECTED]> wrote:
> > http://dev.rubyonrails.org/ticket/2597
> >
> >  I have uploaded a patch that enhances/refactors Model.count (and couple of
> > other things) so that paginate works, as advertised, with named associations
> > (and eager loading).  This patch works great for me.  It passes all the AR
> > unit tests in MySQL, but a couple fail in sqlite.  Please read the comments
> > I posted in the ticket about the patch I uploaded and let me know what you
> > all think.
> >
> >  Thanks,
> >  Jeremy
> >
>
_______________________________________________
Rails-core mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to