开发者

Debug Rails Active Record Query

开发者 https://www.devze.com 2023-03-09 23:44 出处:网络
Is there a way debug ActiveRecord queries before they are executed rather t开发者_Python百科han after?You can call .to_sql on the end of the query to output the sql that it generates like so:

Is there a way debug ActiveRecord queries before they are executed rather t开发者_Python百科han after?


You can call .to_sql on the end of the query to output the sql that it generates like so:

SomeModel.where(:stuff => 'is here').to_sql
0

精彩评论

暂无评论...
验证码 换一张
取 消