Michael Schuerig wrote:
> On Tuesday 07 September 2010, Marnen Laibow-Koser wrote:
>> Michael Schuerig wrote:
>
>> TDD. :)
> Then don't complain if the reaction indicates a failure.
I wasn't the one complaining, was I?
[...]
>> I may have something else for you. I believe I am close, at any
>>
On Tuesday 07 September 2010, Marnen Laibow-Koser wrote:
> Michael Schuerig wrote:
> 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.
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 th
On Saturday 04 September 2010, Colin Law wrote:
> On 4 September 2010 09:14, 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 We
On 4 September 2010 09:14, 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 -- retu
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
> -- i
Marnen Laibow-Koser wrote:
> [...]
>>> [outer SELECT and JOIN as above]
>>> ORDER BY article.id, version.created_at desc
>>> GROUP BY article.id
>>> [further JOINs may be necessary in some DBs, but the principle holds]
>>
>> How does this ensure that I get the latest version?
>
> Sorry, I meant
Michael Schuerig wrote:
> On Friday 03 September 2010, Marnen Laibow-Koser wrote:
>> Then I'm not sure why :joins won't do the trick.
> Because :joins, doing a simple inner join on articles and versions,
> creates a relation with a row for each version. I want one row, made up
> from an article wit
On Friday 03 September 2010, Marnen Laibow-Koser wrote:
> Michael Schuerig wrote:
> > On Friday 03 September 2010, Marnen Laibow-Koser wrote:
> >> On further reflection, I don't know why you would need an outer
> >> join unless not every Article has a Version associated. Is that
> >> the case?
> >
Michael Schuerig wrote:
> On Friday 03 September 2010, Marnen Laibow-Koser wrote:
>>
>> On further reflection, I don't know why you would need an outer join
>> unless not every Article has a Version associated. Is that the case?
>
> I need an *inner* join with the latest of several versions, pos
On Friday 03 September 2010, Marnen Laibow-Koser wrote:
> I had a couple more ideas just after I posted.
>
> Marnen Laibow-Koser wrote:
> > Michael Schuerig wrote:
> [...]
>
> >> :joins with a symbol does an inner join.
> >
> > So use an SQL fragment if you need an outer join (which, on
> > refl
I had a couple more ideas just after I posted.
Marnen Laibow-Koser wrote:
> Michael Schuerig wrote:
[...]
>> :joins with a symbol does an inner join.
>
> So use an SQL fragment if you need an outer join (which, on reflection,
> I suppose you do).
On further reflection, I don't know why you wou
Michael Schuerig wrote:
> On Friday 03 September 2010, Marnen Laibow-Koser wrote:
>> > end
>>
>[...]
>> model, all your Article data fields are really in the Version object.
>> That's cumbersome, as you're finding out.
>
> The data model expresses what I need.
Maybe not. If you're finding it
On Friday 03 September 2010, Marnen Laibow-Koser wrote:
> Michael Schuerig wrote:
> > Firstly, I've asked a similar question before[*]. I didn't get any
> > answers back then, maybe now I have better luck
> >
> > Let's say I have models like this
> >
> > class Article < ActiveRecord::Base
> >
On Friday 03 September 2010, Michael Pavling wrote:
> On 2 September 2010 22:49, Michael Schuerig
wrote:
> > Firstly, I've asked a similar question before[*]. I didn't get any
> > answers back then, maybe now I have better luck
>
> It's hard to answer your post, as your only question is in the
>
Michael Schuerig wrote:
> Firstly, I've asked a similar question before[*]. I didn't get any
> answers back then, maybe now I have better luck
>
> Let's say I have models like this
>
>
> class Article < ActiveRecord::Base
> has_many :versions
> end
>
> class Version < ActiveRecord::Ba
16 matches
Mail list logo