When a client hits my Rails app’s API for data, I would like to pass back the query that generated the data with the data. I’m using Rails 2.
Right now I’ve edited the Rails mysql_adapter to put all queries in a global hash that has the user session as a key and the query as a value.
This is very hacky and probably not thread-safe.
Is there a better way?
You can use fake_arel gem to get the
.to_sqlfunctionality into rails 2.