Reputation: 36243
I've seen somewhere but can not remember. How to get a SQL string from an ActiveRecord object?
Client.find(1).to_sql_string
Upvotes: 1
Views: 383
Reputation: 83680
In Rails 3 you can use to_sql
method
Client.first.to_sql
#=> some raw sql
Upvotes: 3