Sunday, January 3, 2010

[Rails] Re: Named Scopes and Created At

On Jan 3, 5:14 pm, jm <jmmon...@gmail.com> wrote:
>   Post Load (0.4ms)   SELECT * FROM "posts" INNER JOIN "posts_tags" ON
> "posts".id = "posts_tags".post_id WHERE ("posts_tags".tag_id = 1 ) AND
> (("posts"."published" = 't') AND ("posts_tags".tag_id = 1 )) ORDER BY
> posts.created_at DESC

This is probably the query at fault - you want to put the :select
option on the association itself, not the named scope

Fred

--

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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate