xeon wrote:
> Hi,
> 
> I would like to know for each running model action, how can I retrieve
> the SQL running behind? I don't want to scan log each time for the sql
> running behind.
> E.g. post.find(:all,:conditions=>{:id=>'1'}
> 
> I wanna debug the sql generated behind, is that other shorthand
> function like post.find().show_sql() that enable
> us to view what's SQL generated ?

That sounds like a good idea. Perhaps a
:log => :instance_variable_name option to find.

One alternative is the query_trace plugin that displays
a backtrace for each query, so that the log shows what
line of code is associated with each query.

-- 
Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.com

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

Reply via email to