Paul
Paul

Reputation: 26640

Rails: View ActiveRecord's resulting query

ActiveRecord's query interface seems for me sometimes very complex and not intuitive. Is there a possibility to view in which SQL query results Rails construction I have written?

Upvotes: 2

Views: 233

Answers (1)

Chuck Callebs
Chuck Callebs

Reputation: 16431

If you look in the console with the web server running, you will see what the ActiveRecord queries are compiled into. Additionally, you can open up the Rails console (rails console) and inspect them manually.

Upvotes: 3

Related Questions