On 7 July 2010 21:59, Robert Walker wrote:
> RubyonRails_newbie wrote:
>> def comment
>> �...@blogcomment = Blogcomment.find(:all, :order => "created_at
>> desc")
>
> I don't understand the point to this. See next comment...
>
>> @user = User.find(session[:user_id])
>
> Nor this...
>
>>
RubyonRails_newbie wrote:
> ah yes... :-)
>
> It is in the log:
>
> 0mSELECT * FROM `blogcomments` ORDER BY created_at desc LIMIT 1
>
> So if it is in the log, why isn't it ordering the comments?
'LIMIT 1' at the end of that SQL query means that only one record is
being returned. Either you ha
RubyonRails_newbie wrote:
> def comment
> @blogcomment = Blogcomment.find(:all, :order => "created_at
> desc")
I don't understand the point to this. See next comment...
> @user = User.find(session[:user_id])
Nor this...
>
> Blogpost.find(params[:id]).blogcomments.create(params
On 7 July 2010 21:46, RubyonRails_newbie wrote:
> ah yes... :-)
>
> It is in the log:
>
> 0mSELECT * FROM `blogcomments` ORDER BY created_at desc LIMIT 1
>
> So if it is in the log, why isn't it ordering the comments?
What is it that seems to not be sorted? @blogcomment should be sorted
but you
ah yes... :-)
It is in the log:
0mSELECT * FROM `blogcomments` ORDER BY created_at desc LIMIT 1
So if it is in the log, why isn't it ordering the comments?
On 7 July, 21:42, Colin Law wrote:
> On 7 July 2010 21:25, RubyonRails_newbie wrote:
>
> > Hmm,
>
> > for some reason the log isn't showi
On 7 July 2010 21:25, RubyonRails_newbie wrote:
> Hmm,
>
> for some reason the log isn't showing the order by clause:
>
> Rendering blogposts/show
> [4;35;1mBlogcomment Load (0.4ms) [0m [0mSELECT * FROM
> `blogcomments` WHERE (`blogcomments`.blogpost_id = 17) [0m
> [4;36;1mBlogcomment Colu
that can't be - either your syntax is incorrect and it shows an error
in the log and on the screen, or it is correct and it shows the SELECT
with the ORDER clause. Your syntax appears to be correct, by the way.
On Wed, Jul 7, 2010 at 3:30 PM, RubyonRails_newbie
wrote:
> what I mean is that the o
what I mean is that the orderby isn't been used.
the latest entry in the log just shows the select query without the
order by.
On 7 July, 21:28, Jason Michael wrote:
> it has to - it shows every query
>
> On Wed, Jul 7, 2010 at 3:25 PM, RubyonRails_newbie
>
>
>
> wrote:
> > Hmm,
>
> > for some
it has to - it shows every query
On Wed, Jul 7, 2010 at 3:25 PM, RubyonRails_newbie
wrote:
> Hmm,
>
> for some reason the log isn't showing the order by clause:
>
> Rendering blogposts/show
> [4;35;1mBlogcomment Load (0.4ms) [0m [0mSELECT * FROM
> `blogcomments` WHERE (`blogcomments`.blogpos
Hmm,
for some reason the log isn't showing the order by clause:
Rendering blogposts/show
[4;35;1mBlogcomment Load (0.4ms) [0m[0mSELECT * FROM
`blogcomments` WHERE (`blogcomments`.blogpost_id = 17) [0m
[4;36;1mBlogcomment Columns (1.3ms) [0m[0;1mSHOW FIELDS FROM
`blogcomments` [0m
C
10 matches
Mail list logo