Wednesday, October 14, 2009

Script Console Tricks

Script console in rails helps me very much to debug my applications. However, I usually encounter an annoying problem with ActiveRecord. I want to see the generated SQL that has been executed. I never have enough time to figure out this until last week. Just add the following code to your environment.rb, you could see the generated SQL statement.


if "irb" == $0
ActiveRecord::Base.logger = Logger.new(STDOUT) # ActiveRecord
ActiveResource::Base.logger = Logger.new(STDOUT) # ActiveResource
end


For more information:
http://weblog.jamisbuck.org/2007/1/31/more-on-watching-activerecord
http://railscasts.com/episodes/48-console-tricks

9 comments:

Anonymous said...

It was rather interesting for me to read this article. Thank author for it. I like such topics and everything connected to this matter. I definitely want to read a bit more soon.

chamnap said...

Thanks for reading

Webplore said...

Good tips ,its very much useful and helpful tips....
Web Development

Webplore said...

Good tips ,its very much useful and helpful tips....
Web Development

Unknown said...

It was fairly fascinating for me to peruse this article. Thank creator for it. I like such themes and everything associated with this matter. I certainly need to peruse notably all the more soon..


E-Commerce Website Design//Creative Apps And Webs

Unknown said...

I am impressed your provided information is very helpful for me. I think WordPress is a content management software that you can use it to create a beautiful website or blog. WordPress is free, but the kind of features and ease of utilization are priceless. There are over 60 million people who are using WordPress CMS to power their website.

SEO Experts Lounge said...

Every web solution company should provide the services in joomla website development,Wordpress development,Magento development and ecommerce development.Then only that company would considered as good web design company by consumers.
SEO Experts Lounge
Web Development Company in Pakistan
Web Designing Company Pakistan
SEO Company in Lahore
PPC Service in Pakistan

Umar Waqas said...

Web Developement in Lahore. Web Developement company in pakistan. Web designing in Pakistan. Best seo company in Lahore. Best seo company in Pakistan.
SEO Experts Lounge
Web Development Company in Pakistan
Web Designing Company Pakistan
SEO Company in Lahore
PPC Service in Pakistan

Anonymous said...

It was rather interesting for me to read this article. Thank author for it. I like such topics and everything connected to this matter. I definitely want to read a bit more soon.
web design and development vancouver ,
wordpress development vancouver ,

Subscribe in a Reader