This works in its current state but feels sloppy.
t = Time.local(2011, 8, 11)
comments_count = Comment.count(:conditions => ["comments.user_id = (?) AND comments.created_at > (?)" , record.user_id, t])
Can anybody suggest a different way I can write this query? I need to return a count of all the comments created after 08/11/2011.
EDIT: Rails 2.3.9
You could clean the code up using named_scopes:
and then your query would be: