Wednesday, January 6, 2010

Re: Where this SQL came from? Fixing app created by others

If you know where the counts are supposed to be presented - in a view
- then work yourself backwards, from the view to the controller action
and into the model.
If the counts are retrieved in the view using requestAction, then find
the controller action specified in the requestAction and work
backwards from there.
Enjoy,
John

On Jan 6, 7:03 pm, Mołot <molots...@gmail.com> wrote:
> App I have to fix issues one query to get data for 20 photos, and then
> issues 20 queries asking, one by one, for comment count on each of
> those photos. However, every single visible place takes this number
> from the result of first query. How can I find the line that issued
> this find? I know this is find as I've grep'd thorough all code and
> checked all ->sql( calls and that's not them. However, this page is
> quite complicated and I fail to track those queries "by the thread to
> the moot", as there is no thread, results aren't even used.
>
> If you're about to tell me "rtfm" then I'll gladly do so, just gimme a
> link or google search terms to get this fm. I failed after about an
> hour.
>
> Best regards
> Molot

No comments: