Re: Objects with versions: how to avoid 1 + n queries?

Michael Schuerig wrote:
> On Friday 03 September 2010, Marnen Laibow-Koser wrote:
>> Marnen Laibow-Koser wrote:
> 
>> Well, you learn something new every day!  I found the Ambiguous
>> Groups article on the Web and found that the behavior I thought was
>> standard -- returning the first value in the case of multiple values
>> -- is actually a MySQL quirk (ironic when you consider that I
>> haven't used MySQL in years).  Back to the drawing board.
> 
> I did tell you that you ought to understand a problem before jumping to
> solutions, didn't I?

I believe I do understand the problem; I was incorrect regarding the SQL 
standard, however.

I am still considering a better solution for your problem, though I'll 
admit that the spirit in which my attempts have so far been received is 
not exactly encouraging me to spend much more time on the issue.

> I have to admit I was piqued by your reaction to my
> original question: it was bold -- and ignorant. 

Sometimes the best way to tease out the right solution is to propose a 
solution and see where it fails.  Consider it to be mailing list TDD. :)

And *of course* my initial answer was ignorant.  I can't see your code 
or DB, so I only know as much about it as you post to the list.  That 
description will almost inevitably be incomplete.

> You don't have to answer
> every question in this mailing list single-handedly.

I don't try to.  I help where I believe I have useful knowledge.  In 
this case, I was also helping in order to keep my own DB skills sharp.

> 
> Anyway, I'm still looking for a way to express the existing, working SQL
> solutions (sub-select for the latest version corresponding to an
> article) in elegant ActiveRecord code.

I may have something else for you.  I believe I am close, at any rate. 
But patronizing those who are trying to help you is not the way to get 
them to continue helping.

> 
> Michael
> 
> --
> Michael Schuerig
> mailto:michael@...
> http://www.schuerig.de/michael/

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@...
-- 
Posted via http://www.ruby-forum.com/.

--

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


Gmane