2

In development mode, I can see SQL statements in the rails server logs. How can I determine what is creating those SQL statements?

sunnyrjuneja
  • 6,033
  • 2
  • 32
  • 51
  • I look for the controller action that precedes them. It should post whether its a `put`, `post` and `get` request.. and what action performed the request. – Trip Apr 11 '14 at 23:33
  • 1
    Similar question for Rails 3 - http://stackoverflow.com/questions/4530870/tracing-rails-3-sql-queries – Christian Apr 12 '14 at 01:23

1 Answers1

0

Try active_record_query_trace gem.

See https://github.com/brunofacca/active-record-query-trace

Dmitry Ukolov
  • 658
  • 7
  • 10