I'm reading through a open source Rails project code and I see SQL statements in the development log that I can't map to the Rails code, i.e., I have no idea where it is called from. I tried ruby-debug but it seems to be out of sync with the log file output and the code itself, so it hasn't been too useful. Any suggestions on how to debug this?
Someone asked which open source project, it's Insoshi and here's a snippet of the SQL statements I'm trying to map to Rails code.
←[4;36;1mForum Columns (0.0ms)←[0m ←[0;1mSHOW FIELDS FROM `forums`←[0m
←[4;35;1mSQL (15.0ms)←[0m ←[0mSELECT count(*) AS count_all FROM `forums` ←[0m
←[4;36;1mForum Load (0.0ms)←[0m ←[0;1mSELECT * FROM `forums` LIMIT 1←[0m
I don't think the above info is helpful unless you already know the code but here it is anyway. I didn't show any Rails code because I don't know where it's called from. This is a generic debugging problem that I'm going to have all through the code as I'm figuring out how it works.