On 25 Sep 2008, at 04:14, David Stevenson wrote:

>
> Koz et al,
>
> I'm trying to write a patch for this ticket:
>
> http://rails.lighthouseapp.com/projects/8994/tickets/1104-references_eager_loaded_tables-should-search-tables-in-join-clauses
>
> I want to make rails better at guessing which style of :include to
> execute (pre-2.1 vs 2.1+), but I don't see any tests like what I'm
> trying to test in eager_test.rb
>
> So how would I test that rails is doing the :include one way vs
> another?  Both would work and produce identical results at the end, so
> it seems not possible to functionally test this.  Yet all these tests
> check the function of finders, rather than unit testing the individual
> support methods (I could obviously test this by unit testing
> references_eager_loaded_tables? method).  Normally here, I'd use
> expectations to see that things are working under the hood the right
> way...
>

Neat - I've been hitting that recently. Bit of a kludge but could you  
just look at the number of queries made (ie 1 for join based monster,  
number of associations + 1 in other cases) ?

Fred

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to